Bug 56500 - Unknown lvalue 'ConditionFileNotEmpty' in section 'Unit'. Ignoring. [ w/ patch ]
Summary: Unknown lvalue 'ConditionFileNotEmpty' in section 'Unit'. Ignoring. [ w/ patch ]
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: high blocker
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-28 16:43 UTC by Oleksii Shevchuk
Modified: 2012-11-19 08:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Add missing ConditionFileNotEmpty (1.01 KB, patch)
2012-11-01 22:34 UTC, Oleksii Shevchuk
Details | Splinter Review

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.