> cat /etc/systemd/system/sshd-keygen@.service [Unit] Description=Generate SSH keys, if not present ConditionPathExists=!/etc/ssh/ssh_host_%i_key ConditionFileNotEmpty=!/etc/ssh/ssh_host_%i_key Before=sshd.service [Service] Type=oneshot ExecStart=/bin/rm -f /etc/ssh/ssh_host_%i_key ExecStart=/usr/bin/ssh-keygen -t %i -f /etc/ssh/ssh_host_%i_key -N '' [Install] RequiredBy=sshd.service # systemctl daemon-reload # journalctl -ban1 _COMM=systemd --no-pager -- Logs begin at Mon, 2012-10-15 23:01:05 EEST, end at Fri, 2012-10-19 22:25:36 EEST. -- Oct 28 18:39:29 BlackICE systemd[1]: [/etc/systemd/system/sshd-keygen@.service:4] Unknown lvalue 'ConditionFileNotEmpty' in section 'Unit'. Ignoring. # man systemd.unit | grep -A 2 ConditionFileNotEmpty ConditionPathIsMountPoint=, ConditionPathIsReadWrite=, ConditionDirectoryNotEmpty=, ConditionFileNotEmpty=, ConditionFileIsExecutable=, ConditionKernelCommandLine=, ConditionVirtualization=, ConditionSecurity=, ConditionCapability=, ConditionHost=, ConditionNull= -- ConditionFileNotEmpty= is similar to ConditionPathExists= but verifies whether a certain path exists and refers to a regular file with a non-zero size. # systemctl --version systemd 195 gentoo +PAM +LIBWRAP +AUDIT -SELINUX +IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ
Looks like CONDITION_FILE_NOT_EMPTY missing in load-fragment-gperf.c table.
Created attachment 69403 [details] [review] Add missing ConditionFileNotEmpty
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.