Bug 56500

Summary: Unknown lvalue 'ConditionFileNotEmpty' in section 'Unit'. Ignoring. [ w/ patch ]
Product: systemd Reporter: Oleksii Shevchuk <public.avatar>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: blocker    
Priority: high    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Add missing ConditionFileNotEmpty

Description Oleksii Shevchuk 2012-10-28 16:43:07 UTC
> 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
Comment 1 Oleksii Shevchuk 2012-11-01 22:31:06 UTC
Looks like CONDITION_FILE_NOT_EMPTY missing in load-fragment-gperf.c table.
Comment 2 Oleksii Shevchuk 2012-11-01 22:34:44 UTC
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.