Bug 292526 - kde-config-cron config module does not allow DISPLAY=:0.0
Summary: kde-config-cron config module does not allow DISPLAY=:0.0
Status: RESOLVED FIXED
Alias: None
Product: kcron
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Gary Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-26 21:55 UTC by illumilore
Modified: 2015-05-04 22:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description illumilore 2012-01-26 21:55:20 UTC
Version:           unspecified (using KDE 4.7.4) 
OS:                Linux

System settings with the kde-config-cron configuration module installed, system settings>task scheduler, when adding a command to run, does not recognise commands that have environments pre-settings preceding it, even if the command itself is valid. So if you try to make a new command that requires something like DISPLAY=:0.0 to precede it, system settings will not allow that.

Reproducible: Always

Steps to Reproduce:
na

Actual Results:  
na

Expected Results:  
na

na
Comment 1 Christoph Feck 2012-01-26 23:11:15 UTC
See also bug 237593 comment #2.
Comment 2 illumilore 2012-01-27 00:10:38 UTC
I tried setting the environment with the variable DISPLAY and a value of 0.0 , but it doesn't seem to take effect there, so is that bugged too, or is there some trick to setting that particular environment variable?

And would it be possible to change it so that only a warning is given if it doesn't like the command input, instead of also disabling the okay button? It seems like it is unnecessarily crippled considering that crontab allows me to do this, while this frontend does not.
Comment 3 Christoph Feck 2012-01-27 18:06:26 UTC
> value of 0.0

I hope you tried :0.0

If you added DISPLAY to the variables, it should be written to your crontab.  Please use "crontab -l" to verify this.

> considering that crontab allows me to do this

To do what?
Comment 4 illumilore 2012-01-27 23:27:12 UTC
>To do what?

It allows environment variables in the command line itself, so you can have individual environments for each command. I do not see why kde-config-cron should have reduced functionality concerning this. Maybe make the warning that it gives when it does not like the input command line just a warning and not actually prevent it from being applied?
Comment 5 Christoph Feck 2012-03-18 21:30:42 UTC
I am very sure the original (UNIX) version of "cron" does not allow prepending variable settings to commands, it might be possible this feature has been added in other versions of cron, such as anacron. Which version do you use?
Comment 6 illumilore 2012-03-18 22:36:38 UTC
Just the normal version 3 cron that comes with ubuntu with the crontab that comes with it.
Comment 7 Franciszek Janowski 2012-09-06 11:51:48 UTC
I can confirm this in Opensuse 12.1, KDE 4.9. No way to add or modify task, when 'export DISPLAY=:0' is at the beginning. These tasks were added in console cron and work without problems.
Comment 8 Christoph Feck 2014-11-16 19:15:48 UTC
So to summarize, the correct way to start X applications from cron is to have a cron command like:

    export DISPLAY=display && mycommand

or

    env DISPLAY=display mycommand

but not

    DISPLAY=<display> mycommand

(as is supported by bash)

Correct?
Comment 9 illumilore 2014-11-16 20:18:02 UTC
Yes, kcron still seems to not allow  DISPLAY=<display> because it doesn't see it as a command. Maybe it should only warn the user instead of outright disallowing it?