Bug 61535 - systemctl injects an '-n' flag for the syslog-ng service when the service file is named syslog-ng.service
Summary: systemctl injects an '-n' flag for the syslog-ng service when the service fil...
Status: RESOLVED INVALID
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-27 00:38 UTC by P. Levine
Modified: 2013-02-27 10:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description P. Levine 2013-02-27 00:38:59 UTC
When starting the service syslog-ng.service the service fails as described in https://bugs.freedesktop.org/show_bug.cgi?id=61324 .

"journalctl --no-pager -o verbose -xan" displays:

-- Unit syslog-ng.service has begun starting up.
Tue 2013-02-26 19:17:04 EST [s=4bf1de8dd3124568a43961db7461c296;i=1c5c;b=63ee8a7e2426480fbcc4c70adcb14b7e;m=63c0ffa7;t=4d6a9b197c402;x=13152f7c6b85e8ff]
        _UID=0
        _GID=0
        _BOOT_ID=63ee8a7e2426480fbcc4c70adcb14b7e
        _MACHINE_ID=6a1d4ffd3e67b15aac8170c451004e6b
        _HOSTNAME=Laptop-PC
        PRIORITY=7
        SYSLOG_IDENTIFIER=systemd
        SYSLOG_FACILITY=3
        _TRANSPORT=journal
        _PID=1
        _COMM=systemd
        _EXE=/usr/lib64/systemd/systemd
        _CMDLINE=/usr/bin/systemd  
        _SYSTEMD_CGROUP=/system
        CODE_FILE=/var/tmp/portage/sys-apps/systemd-197.9999/work/systemd-197.9999/src/core/execute.c
        CODE_LINE=1022
        CODE_FUNCTION=exec_spawn
        UNIT=syslog-ng.service
        MESSAGE=About to execute /usr/sbin/syslog-ng -n
        _SOURCE_REALTIME_TIMESTAMP=1361924224160042



However, after the following commands:

cp /usr/lib/systemd/system/syslog-ng.service /usr/lib/systemd/system/test-syslog.service

systemctl stop syslog-ng

systemctl disable syslog-ng

systemctl enable test-syslog

systemctl start test-syslog



The following is displayed from journal:



-- Unit test-syslog.service has begun starting up.
Tue 2013-02-26 19:09:53 EST [s=4bf1de8dd3124568a43961db7461c296;i=1889;b=63ee8a7e2426480fbcc4c70adcb14b7e;m=4a144d2a;t=4d6a997eb1183;x=b65a98c091ef07e2]
        _UID=0
        _GID=0
        _BOOT_ID=63ee8a7e2426480fbcc4c70adcb14b7e
        _MACHINE_ID=6a1d4ffd3e67b15aac8170c451004e6b
        _HOSTNAME=Laptop-PC
        PRIORITY=7
        SYSLOG_IDENTIFIER=systemd
        SYSLOG_FACILITY=3
        _TRANSPORT=journal
        _PID=1
        _COMM=systemd
        _EXE=/usr/lib64/systemd/systemd
        _CMDLINE=/usr/bin/systemd  
        _SYSTEMD_CGROUP=/system
        CODE_FILE=/var/tmp/portage/sys-apps/systemd-197.9999/work/systemd-197.9999/src/core/execute.c
        CODE_LINE=1022
        CODE_FUNCTION=exec_spawn
        UNIT=test-syslog.service
        MESSAGE=About to execute /usr/sbin/syslog-ng -F
        _SOURCE_REALTIME_TIMESTAMP=1361923793407970



systemd correctly interprets the "-F" flag when the syslog-ng.service is named test-syslog, but injects the '-n' flag if the name remains syslog-ng.service.
Comment 1 P. Levine 2013-02-27 02:45:18 UTC
From "systemctl dump":

-> Unit syslog-ng.service:
        Description: System Logging Service
        Instance: n/a
        Unit Load State: loaded
        Unit Active State: failed
        Inactive Exit Timestamp: Tue 2013-02-26 20:45:09 EST
        Active Enter Timestamp: Tue 2013-02-26 20:45:09 EST
        Active Exit Timestamp: Tue 2013-02-26 20:45:09 EST
        Inactive Enter Timestamp: Tue 2013-02-26 20:45:09 EST
        GC Check Good: yes
        Need Daemon Reload: no
        Name: syslog-ng.service
        Fragment Path: /etc/systemd/system/syslog-ng.service
        Condition Timestamp: Tue 2013-02-26 20:45:09 EST
        Condition Result: yes
        Requires: syslog.socket
        Requires: basic.target
        Conflicts: shutdown.target
        Before: shutdown.target
        After: basic.target
        References: syslog.socket
        References: basic.target
        References: shutdown.target
        StopWhenUnneeded: no
        RefuseManualStart: no
        RefuseManualStop: no
        DefaultDependencies: yes
        OnFailureIsolate: no
        IgnoreOnIsolate: no
        IgnoreOnSnapshot: no
        ControlGroup: cpu:/system/syslog-ng.service
        ControlGroup: name=systemd:/system/syslog-ng.service
        Service State: failed
        Result: exit-code
        Reload Result: success
        PermissionsStartOnly: no
        RootDirectoryStartOnly: no
        RemainAfterExit: no
        GuessMainPID: yes
        Type: simple
        Restart: no
        NotifyAccess: none
        KillMode: control-group
        KillSignal: SIGTERM
        SendSIGKILL: yes
        UMask: 0022
        WorkingDirectory: /
        RootDirectory: /
        NonBlocking: no
        PrivateTmp: no
        ControlGroupModify: no
        ControlGroupPersistent: yes
        PrivateNetwork: no
        IgnoreSIGPIPE: yes
        LimitNOFILE: 4096
        StandardInput: null
        StandardOutput: null
        StandardError: inherit
        -> ExecStart:
                Command Line: /usr/sbin/syslog-ng -n

-> Unit test-syslog.service:
        Description: System Logger Daemon
        Instance: n/a
        Unit Load State: loaded
        Unit Active State: active
        Inactive Exit Timestamp: Tue 2013-02-26 21:40:17 EST
        Active Enter Timestamp: Tue 2013-02-26 21:40:17 EST
        Active Exit Timestamp: n/a
        Inactive Enter Timestamp: n/a
        GC Check Good: yes
        Need Daemon Reload: no
        Name: test-syslog.service
        Name: syslog.service
        Documentation: man:syslog-ng(8)
        Fragment Path: /usr/lib64/systemd/system/test-syslog.service
        Condition Timestamp: Tue 2013-02-26 21:40:17 EST
        Condition Result: yes
        Requires: basic.target
        Wants: syslog.socket
        WantedBy: multi-user.target
        Conflicts: shutdown.target
        Before: shutdown.target
        Before: multi-user.target
        After: syslog.socket
        After: basic.target
        TriggeredBy: syslog.socket
        References: syslog.socket
        References: basic.target
        References: shutdown.target
        ReferencedBy: multi-user.target
        ReferencedBy: syslog.socket
        StopWhenUnneeded: no
        RefuseManualStart: no
        RefuseManualStop: no
        DefaultDependencies: yes
        OnFailureIsolate: no
        IgnoreOnIsolate: no
        IgnoreOnSnapshot: no
        ControlGroup: cpu:/system/test-syslog.service
        ControlGroup: name=systemd:/system/test-syslog.service
        Service State: running
        Result: success
        Reload Result: success
        PermissionsStartOnly: no
        RootDirectoryStartOnly: no
        RemainAfterExit: no
        GuessMainPID: yes
        Type: simple
        Restart: on-failure
        NotifyAccess: none
        Main PID: 6891
        Main PID Known: yes
        Main PID Alien: no
        KillMode: control-group
        KillSignal: SIGTERM
        SendSIGKILL: yes
        UMask: 0022
        WorkingDirectory: /
        RootDirectory: /
        NonBlocking: no
        PrivateTmp: no
        ControlGroupModify: no
        ControlGroupPersistent: yes
        PrivateNetwork: no
        IgnoreSIGPIPE: yes
        LimitNOFILE: 4096
        StandardInput: null
        StandardOutput: null
        StandardError: inherit
        -> ExecStart:
                Command Line: /usr/sbin/syslog-ng -F
                        PID: 6891
                        Start Timestamp: Tue 2013-02-26 21:40:17 EST
        -> ExecReload:
                Command Line: /bin/kill -HUP $MAINPID
Comment 2 P. Levine 2013-02-27 02:50:08 UTC
Contents of /usr/lib/systemd/system/syslog-ng.service:

[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)

[Service]
Sockets=syslog.socket
ExecStart=/usr/sbin/syslog-ng -F
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=null
Restart=on-failure

[Install]
WantedBy=multi-user.target
Alias=syslog.service
Comment 3 Kay Sievers 2013-02-27 03:17:46 UTC
What terribly broken setup is this?
_EXE=/usr/lib64/systemd/systemd

systemd is always lib, never lib64, it's the "application private directory"
not any sort of $libdir.
Comment 4 P. Levine 2013-02-27 03:24:17 UTC
Please disregard.

I'm an idiot.

An old syslog-ng.service test file was left in /etc/systemd/system/ dir.

:<
Comment 5 P. Levine 2013-02-27 03:29:47 UTC
The setup is Gentoo.  Gentoo's /usr/lib is a link to /usr/lib64.

On another note, I'm sorry for wasting everyone's time.  I
had forgotten that earlier I had setup a syslog-ng.system file
in /etc/systemd/system.  It was overriding the one installed later.

I feel like an idiot.

:<

On Tue, Feb 26, 2013 at 10:17 PM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 3 <https://bugs.freedesktop.org/show_bug.cgi?id=61535#c3> on bug
> 61535 <https://bugs.freedesktop.org/show_bug.cgi?id=61535> from Kay
> Sievers <kay@vrfy.org> *
>
> What terribly broken setup is this?
> _EXE=/usr/lib64/systemd/systemd
>
> systemd is always lib, never lib64, it's the "application private directory"
> not any sort of $libdir.
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>
>
Comment 6 Kay Sievers 2013-02-27 10:33:37 UTC
(In reply to comment #5)
> The setup is Gentoo.  Gentoo's /usr/lib is a link to /usr/lib64.

It's unrelated to that bug, but ...

Urks, we had this kind of brokeneness with udev on Gentoo years ago already
and they fixed it some day, and now it's back for systemd?

This is really wrong to set up things that way. lib64 is for shared libraries,
lib is the common place for system data, both have nothing to do with each
other. This should really be fixed in Gentoo, it's a broken idea to mangle
stuff that way.

Unless Gentoo starts to introduce bin64, lib is the common place just like
bin, and it should make it pretty clear that the systemd private dir is not
a 64 thing.

> On another note, I'm sorry for wasting everyone's time.  I
> had forgotten that earlier I had setup a syslog-ng.system file
> in /etc/systemd/system.  It was overriding the one installed later.
> 
> I feel like an idiot.

Nothing to be sorry about, we all work that way, and we are all wrong here
and there.

Only if you do nothing, you do nothing wrong. :)


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.