Bug#771830: generator doesn't find python at boot if /usr is a separate mount

Alexandre Detiste alexandre.detiste at gmail.com
Wed Dec 3 09:07:04 GMT 2014


I pushed now this commit to check that argv[1] is actually a folder:
[1] https://github.com/systemd-cron/systemd-cron/commit/38ff088f4f3482069575c381fcdb8ecaa28a2cb8

> -=*[ROOT ZSH]*=- root at juhtolv | Tue 02 Dec 2014 19:43:37 | 8404 | pts/1.1
> /root
> # /lib/systemd/system-generators/systemd-crontab-generator
> Traceback (most recent call last):
>   File "/lib/systemd/system-generators/systemd-crontab-generator",
> line 19, in <module>
>     TARGER_DIR = sys.argv[1]
>     IndexError: list index out of range
>     [1]    6032 exit 1
> /lib/systemd/system-generators/systemd-crontab-generator

With pending v1.4.2-1: 
# /lib/systemd/system-generators/systemd-crontab-generator
Usage: out/build/bin/systemd-crontab-generator <destination_folder>
 
> 
> -=*[ROOT ZSH]*=- root at juhtolv | Tue 02 Dec 2014 19:43:59 | 8405 | pts/1.1
> /root
> # /lib/systemd/system-generators/systemd-crontab-generator
> /etc/crontab
> Traceback (most recent call last):
>   File "/lib/systemd/system-generators/systemd-crontab-generator",
> line 32, in <module>
>     os.makedirs(TIMERS_DIR)
>       File "/usr/lib/python2.7/os.py", line 157, in makedirs
>           mkdir(name, mode)
>           OSError: [Errno 20] Not a directory:
> '/etc/crontab/cron.target.wants'
> [1]    6094 exit 1

With master:
# /lib/systemd/system-generators/systemd-crontab-generator /etc/crontab
Usage: out/build/bin/systemd-crontab-generator <destination_folder>

> Is that command really so stupid, that it only accepts folders and not files?
The files are at fixed locations defined during the build.
When systemd run the generator, it allways call it with "/run/systemd/generator" as argv[1]

Anyway, the generator are out of the $PATH for a reason: they are not meant to be called manually;
/lib/systemd/system/cron-update.path monitor the crontabs and call the generator automatically.

Alexandre Detiste




More information about the Pkg-systemd-maintainers mailing list