Bug 1015050 - Error in systemd unit
Error in systemd unit
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: lsyncd (Show other bugs)
19
Unspecified Unspecified
urgent Severity high
: ---
: ---
Assigned To: Lubomir Rintel
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-03 07:28 EDT by Sebastien Pasche
Modified: 2014-10-03 05:03 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-10-03 05:03:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sebastien Pasche 2013-10-03 07:28:23 EDT
Description of problem:

There are an error in systemd unit file of lsyncd

systemctl start lsyncd.service
[root@mgbstai02 log]# ps aux | grep lsyncd
root       972  0.0  0.0 115232  1100 ?        SNs  13:16   0:00 /usr/bin/sh -c eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd.conf`
root       973  0.0  0.0 115232   596 ?        SN   13:16   0:00 /usr/bin/sh -c eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd.conf`
root       974  3.5  0.1  30964 20232 ?        SN   13:16   0:00 /usr/bin/lsyncd -nodaemon /etc/lsyncd.conf

As you can see in the preview capture, the sysconfig file is not realy used

the sysconfig file look like this 

# Keep the space there for systemd. Don't nest variables without
# changing the systemd service file to use: /usr/bin/sh -c 'eval XXXX'
#
#LSYNCD_OPTIONS="-pidfile /var/run/lsyncd.pid /etc/lsyncd.conf"

But the line is commented.. and should look like that

# Keep the space there for systemd. Don't nest variables without
# changing the systemd service file to use: /usr/bin/sh -c 'eval XXXX'
#
LSYNCD_OPTIONS="-pidfile /var/run/lsyncd.pid /etc/lsyncd.conf"

To work properly

Then there is a duplication of the configuration file setting in the unit

the unit look like this

[Unit]
Description=Live Syncing (Mirror) Daemon
After=network.target

[Service]
Type=simple
Nice=19
EnvironmentFile=-/etc/sysconfig/lsyncd
ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd.conf`'

[Install]
WantedBy=multi-user.target
~                               

If I follow the way you want to build your unit, you don't have to specify again the path to conf then : 

[Unit]
Description=Live Syncing (Mirror) Daemon
After=network.target

[Service]
Type=simple
Nice=19
EnvironmentFile=-/etc/sysconfig/lsyncd
ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS`'

[Install]
WantedBy=multi-user.target
~                               

And finally it's working

[root@mgbstai02 log]# systemctl daemon-reload
[root@mgbstai02 log]# systemctl restart lsyncd.service 
[root@mgbstai02 log]# ps aux | grep lsyncd
root      1297  0.0  0.0 115232  1096 ?        SNs  13:23   0:00 /usr/bin/sh -c eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS`
root      1298  0.0  0.0 115232   604 ?        SN   13:23   0:00 /usr/bin/sh -c eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS`
root      1299 10.8  0.1  30960 20228 ?        SN   13:23   0:00 /usr/bin/lsyncd -nodaemon -pidfile /var/run/lsyncd.pid /etc/lsyncd.conf


Version-Release number of selected component (if applicable):

[root@mgbstai02 log]# cat /etc/redhat-release 
Fedora release 19 (Schrödinger’s Cat)
[root@mgbstai02 log]# rpm -qa | grep lsyncd
lsyncd-2.1.4-3.fc19.x86_64


How reproducible:

just install lsyncd

Steps to Reproduce:
1. yum install lsyncd
2. fix missing /var/log/lsyncd directroy (https://bugzilla.redhat.com/show_bug.cgi?id=1015042)
3. systemctl start lsyncd.service

Actual results:


Expected results:


Additional info:
Comment 1 Lubomir Rintel 2014-10-02 15:26:08 EDT
I don't quite get what did you do here.

You uncommented a line in an example file effectively adding a duplicate option and then complained that there's a duplicate option?
Comment 2 Sebastien Pasche 2014-10-03 05:03:51 EDT
Sorry .. long time ago :-)

In your unit you specify the configuration as 

ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd.conf`'

and in the config file you this commanted line

#LSYNCD_OPTIONS="-pidfile /var/run/lsyncd.pid /etc/lsyncd.conf"

At the epoch I think I was thinking about removing /etc/lsyncd.conf from that line and enable the pid creation by default.

Sorry if it was really unclear :(

Nowadays I think this tiquet is no more usefull and I will just close it.

Sorry for the annoying comment :)

Note You need to log in before you can comment on or make changes to this bug.