You are not logged in.

#1 2017-12-18 09:54:42

justasug
Member
Registered: 2014-08-03
Posts: 174

[SOLVED] MPD keeps running after logout

I am starting MPD via Openbox's autostart file after the X session starts. When I end my X session, MPD is still running as my user in the background. Starting MPD with the --no-daemon option has no effect on that and it still persists after logging out.

Is there and what is the best approach to exit MPD when my user's session ends?

I have KillUserProcesses=yes in my logind.conf, but I think that only affects systemd services? Is there a way to accomplish this without a hacky script that gets executed upon logout and kills MPD and other potential processes that forked to the background? How could I tie MPD and other programs to Openbox, so that when Openbox exits, those programs exit too (like the majority of other programs)?

Last edited by justasug (2017-12-18 17:54:01)

Offline

#2 2017-12-18 15:11:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: [SOLVED] MPD keeps running after logout

justasug wrote:

I have KillUserProcesses=yes in my logind.conf, but I think that only affects systemd services?

It shouldn't.  But it should only take effect when you actually log out, not just when your X session ends.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2017-12-18 17:50:33

justasug
Member
Registered: 2014-08-03
Posts: 174

Re: [SOLVED] MPD keeps running after logout

Trilby wrote:
justasug wrote:

I have KillUserProcesses=yes in my logind.conf, but I think that only affects systemd services?

It shouldn't.  But it should only take effect when you actually log out, not just when your X session ends.

Log out as in loginctl will stop showing my user session?

This is what is says while I'm logged in, running an Openbox X session started via LigthDM:

$ loginctl
   SESSION        UID USER             SEAT             TTY             
        c1       1000 dino             seat0                            

1 sessions listed.
$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.8  0.2 231956  8112 ?        Ss   18:34   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S    18:34   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/0:0]
root         4  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/0:0H]
root         5  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:0]
root         6  0.0  0.0      0     0 ?        I<   18:34   0:00 [mm_percpu_wq]
root         7  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/0]
root         8  0.0  0.0      0     0 ?        I    18:34   0:00 [rcu_preempt]
root         9  0.0  0.0      0     0 ?        I    18:34   0:00 [rcu_sched]
root        10  0.0  0.0      0     0 ?        I    18:34   0:00 [rcu_bh]
root        11  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/0]
root        12  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/0]
root        13  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/0]
root        14  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/1]
root        15  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/1]
root        16  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/1]
root        17  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/1]
root        18  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/1:0]
root        19  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/1:0H]
root        20  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/2]
root        21  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/2]
root        22  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/2]
root        23  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/2]
root        24  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/2:0]
root        25  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/2:0H]
root        26  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/3]
root        27  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/3]
root        28  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/3]
root        29  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/3]
root        30  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/3:0]
root        31  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/3:0H]
root        32  0.0  0.0      0     0 ?        S    18:34   0:00 [kdevtmpfs]
root        33  0.0  0.0      0     0 ?        I<   18:34   0:00 [netns]
root        34  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/0:1]
root        35  0.0  0.0      0     0 ?        R    18:34   0:00 [kworker/1:1]
root        36  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/2:1]
root        37  0.0  0.0      0     0 ?        S    18:34   0:00 [khungtaskd]
root        38  0.0  0.0      0     0 ?        S    18:34   0:00 [oom_reaper]
root        39  0.0  0.0      0     0 ?        I<   18:34   0:00 [writeback]
root        40  0.0  0.0      0     0 ?        S    18:34   0:00 [kcompactd0]
root        41  0.0  0.0      0     0 ?        SN   18:34   0:00 [ksmd]
root        42  0.0  0.0      0     0 ?        SN   18:34   0:00 [khugepaged]
root        43  0.0  0.0      0     0 ?        I<   18:34   0:00 [crypto]
root        44  0.0  0.0      0     0 ?        I<   18:34   0:00 [kintegrityd]
root        45  0.0  0.0      0     0 ?        I<   18:34   0:00 [kblockd]
root        46  0.0  0.0      0     0 ?        I<   18:34   0:00 [edac-poller]
root        47  0.0  0.0      0     0 ?        I<   18:34   0:00 [devfreq_wq]
root        48  0.0  0.0      0     0 ?        I<   18:34   0:00 [watchdogd]
root        49  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:1]
root        50  0.1  0.0      0     0 ?        I    18:34   0:00 [kworker/3:1]
root        51  0.0  0.0      0     0 ?        S    18:34   0:00 [kswapd0]
root        89  0.0  0.0      0     0 ?        I<   18:34   0:00 [kthrotld]
root        90  0.0  0.0      0     0 ?        I<   18:34   0:00 [ipv6_addrconf]
root        99  0.0  0.0      0     0 ?        I<   18:34   0:00 [kstrp]
root       132  0.0  0.0      0     0 ?        I<   18:34   0:00 [nvkm-disp]
root       137  0.0  0.0      0     0 ?        I<   18:34   0:00 [ttm_swap]
root       169  0.0  0.0      0     0 ?        I<   18:34   0:00 [ata_sff]
root       171  0.0  0.0      0     0 ?        I<   18:34   0:00 [firewire]
root       172  0.0  0.0      0     0 ?        I<   18:34   0:00 [firewire_ohci]
root       173  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_0]
root       174  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_0]
root       175  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_1]
root       176  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_1]
root       177  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:2]
root       178  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_2]
root       179  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_2]
root       180  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_3]
root       181  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_3]
root       182  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_4]
root       183  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_4]
root       184  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_5]
root       185  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_5]
root       186  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_6]
root       187  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_6]
root       188  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_7]
root       189  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_7]
root       190  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:3]
root       191  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:4]
root       192  0.7  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:5]
root       193  0.1  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:6]
root       194  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:7]
root       195  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:8]
root       196  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:9]
root       197  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/1:2]
root       199  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/0:2]
root       201  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/0:1H]
root       206  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/1:1H]
root       217  0.0  0.0      0     0 ?        S    18:34   0:00 [jbd2/sda2-8]
root       218  0.0  0.0      0     0 ?        I<   18:34   0:00 [ext4-rsv-conver]
root       225  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/3:1H]
root       244  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/2:1H]
root       245  0.1  0.5  96740 20568 ?        Ss   18:34   0:00 /usr/lib/systemd/systemd-journald
root       264  0.5  0.2  83624  8092 ?        Ss   18:34   0:00 /usr/lib/systemd/systemd-udevd
root       386  0.0  0.0      0     0 ?        S    18:34   0:00 [irq/34-mei_me]
root       416  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/0:3]
root       417  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/0:4]
root       418  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/0:5]
systemd+   425  0.0  0.1 150484  5392 ?        Ssl  18:35   0:00 /usr/lib/systemd/systemd-timesyncd
root       427  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/3:2]
dbus       431  0.1  0.1  32720  4028 ?        Ss   18:35   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root       436  0.2  0.4 461816 17352 ?        Ssl  18:35   0:00 /usr/bin/NetworkManager --no-daemon
root       438  0.0  0.1  66164  5664 ?        Ss   18:35   0:00 /usr/lib/systemd/systemd-logind
root       451  0.0  0.1 275460  7120 ?        Ssl  18:35   0:00 /usr/bin/lightdm
root       457  0.0  0.2 284908  8556 ?        Ssl  18:35   0:00 /usr/lib/accountsservice/accounts-daemon
polkitd    462  0.1  0.4 527416 17696 ?        Ssl  18:35   0:00 /usr/lib/polkit-1/polkitd --no-debug
root       470  1.1  1.2 402256 49296 tty7     Ssl+ 18:35   0:00 /usr/lib/xorg-server/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
root       517  0.0  0.1 259928  7584 ?        Sl   18:35   0:00 lightdm --session-child 13 16
dino       521  0.0  0.1  78660  7908 ?        Ss   18:35   0:00 /usr/lib/systemd/systemd --user
dino       522  0.0  0.0 140904  2036 ?        S    18:35   0:00 (sd-pam)
dino       528  0.2  0.4 189492 16864 ?        Ss   18:35   0:00 /usr/bin/openbox --startup /usr/lib/openbox/openbox-autostart OPENBOX
dino       534  0.0  0.0  32376  3184 ?        Ss   18:35   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
dino       544  0.3  0.9 291308 38776 ?        Sl   18:35   0:00 compton --config /home/dino/.config/compton/compton.conf
dino       548  0.0  0.3 205232 15284 ?        S    18:35   0:00 tint2
dino       549  0.3  1.4 907328 56068 ?        Sl   18:35   0:00 volumeicon
dino       550  0.0  0.2  73364 10628 ?        S    18:35   0:00 /usr/bin/python2 /usr/bin/orcsome
dino       551  0.1  0.3 351884 14696 ?        S    18:35   0:00 /usr/bin/python /usr/bin/firefox-dpms
dino       552  1.0  2.6 2496124 104392 ?      Sl   18:35   0:00 qbittorrent
dino       553  0.0  0.0  17052  1808 ?        S    18:35   0:00 sh /home/dino/.config/openbox/autostart
dino       560  0.0  0.2 282328  8852 ?        Ssl  18:35   0:00 /usr/lib/gvfs/gvfsd
dino       566  0.0  0.1 348172  7836 ?        Sl   18:35   0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
dino       573  0.6  0.9 1022120 39320 ?       Rl   18:35   0:00 xfce4-terminal
dino       575  0.2  0.7 527420 29488 ?        Sl   18:35   0:00 nm-applet
dino       583  0.0  0.1 344848  6044 ?        Ssl  18:35   0:00 /usr/lib/at-spi-bus-launcher
dino       586  0.3  0.3 1328892 12404 ?       S<sl 18:35   0:00 /usr/bin/pulseaudio --daemonize=no
dino       589  0.1  0.5 852876 23164 ?        Ssl  18:35   0:00 mpd
rtkit      591  0.0  0.0 174808  2460 ?        SNsl 18:35   0:00 /usr/lib/rtkit-daemon
dino       599  0.0  0.0  32244  3160 ?        S    18:35   0:00 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
dino       601  0.0  0.1 218392  6304 ?        Sl   18:35   0:00 /usr/lib/at-spi2-registryd --use-gnome-session
dino       621  0.1  0.2 143588  9876 ?        S    18:35   0:00 mpdas
dino       626  0.0  0.1  19436  4120 pts/0    Ss   18:35   0:00 bash
dino       654  0.0  0.0  30740  3068 pts/0    R+   18:36   0:00 ps aux

This is what I have after I log out of Openbox and go back to LigthDM's greeter screen. I switched to a tty, logged in as root.

# loginctl    SESSION        UID USER             SEAT             TTY             
        c3          0 root             seat0            tty2            
        c2        620 lightdm          seat0                            

2 sessions listed.
# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.5  0.2 231956  8152 ?        Ss   18:34   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S    18:34   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/0:0]
root         4  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/0:0H]
root         5  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:0]
root         6  0.0  0.0      0     0 ?        I<   18:34   0:00 [mm_percpu_wq]
root         7  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/0]
root         8  0.0  0.0      0     0 ?        I    18:34   0:00 [rcu_preempt]
root         9  0.0  0.0      0     0 ?        I    18:34   0:00 [rcu_sched]
root        10  0.0  0.0      0     0 ?        I    18:34   0:00 [rcu_bh]
root        11  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/0]
root        12  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/0]
root        13  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/0]
root        14  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/1]
root        15  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/1]
root        16  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/1]
root        17  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/1]
root        18  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/1:0]
root        19  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/1:0H]
root        20  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/2]
root        21  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/2]
root        22  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/2]
root        23  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/2]
root        24  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/2:0]
root        25  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/2:0H]
root        26  0.0  0.0      0     0 ?        S    18:34   0:00 [cpuhp/3]
root        27  0.0  0.0      0     0 ?        S    18:34   0:00 [watchdog/3]
root        28  0.0  0.0      0     0 ?        S    18:34   0:00 [migration/3]
root        29  0.0  0.0      0     0 ?        S    18:34   0:00 [ksoftirqd/3]
root        30  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/3:0]
root        31  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/3:0H]
root        32  0.0  0.0      0     0 ?        S    18:34   0:00 [kdevtmpfs]
root        33  0.0  0.0      0     0 ?        I<   18:34   0:00 [netns]
root        34  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/0:1]
root        35  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/1:1]
root        36  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/2:1]
root        37  0.0  0.0      0     0 ?        S    18:34   0:00 [khungtaskd]
root        38  0.0  0.0      0     0 ?        S    18:34   0:00 [oom_reaper]
root        39  0.0  0.0      0     0 ?        I<   18:34   0:00 [writeback]
root        40  0.0  0.0      0     0 ?        S    18:34   0:00 [kcompactd0]
root        41  0.0  0.0      0     0 ?        SN   18:34   0:00 [ksmd]
root        42  0.0  0.0      0     0 ?        SN   18:34   0:00 [khugepaged]
root        43  0.0  0.0      0     0 ?        I<   18:34   0:00 [crypto]
root        44  0.0  0.0      0     0 ?        I<   18:34   0:00 [kintegrityd]
root        45  0.0  0.0      0     0 ?        I<   18:34   0:00 [kblockd]
root        46  0.0  0.0      0     0 ?        I<   18:34   0:00 [edac-poller]
root        47  0.0  0.0      0     0 ?        I<   18:34   0:00 [devfreq_wq]
root        48  0.0  0.0      0     0 ?        I<   18:34   0:00 [watchdogd]
root        49  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:1]
root        50  0.1  0.0      0     0 ?        I    18:34   0:00 [kworker/3:1]
root        51  0.0  0.0      0     0 ?        S    18:34   0:00 [kswapd0]
root        89  0.0  0.0      0     0 ?        I<   18:34   0:00 [kthrotld]
root        90  0.0  0.0      0     0 ?        I<   18:34   0:00 [ipv6_addrconf]
root        99  0.0  0.0      0     0 ?        I<   18:34   0:00 [kstrp]
root       132  0.0  0.0      0     0 ?        I<   18:34   0:00 [nvkm-disp]
root       137  0.0  0.0      0     0 ?        I<   18:34   0:00 [ttm_swap]
root       169  0.0  0.0      0     0 ?        I<   18:34   0:00 [ata_sff]
root       171  0.0  0.0      0     0 ?        I<   18:34   0:00 [firewire]
root       172  0.0  0.0      0     0 ?        I<   18:34   0:00 [firewire_ohci]
root       173  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_0]
root       174  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_0]
root       175  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_1]
root       176  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_1]
root       177  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:2]
root       178  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_2]
root       179  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_2]
root       180  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_3]
root       181  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_3]
root       182  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_4]
root       183  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_4]
root       184  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_5]
root       185  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_5]
root       186  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_6]
root       187  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_6]
root       188  0.0  0.0      0     0 ?        S    18:34   0:00 [scsi_eh_7]
root       189  0.0  0.0      0     0 ?        I<   18:34   0:00 [scsi_tmf_7]
root       190  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:3]
root       191  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:4]
root       192  0.6  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:5]
root       193  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:6]
root       194  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:7]
root       195  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:8]
root       196  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/u8:9]
root       197  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/1:2]
root       199  0.0  0.0      0     0 ?        I    18:34   0:00 [kworker/0:2]
root       201  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/0:1H]
root       206  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/1:1H]
root       217  0.0  0.0      0     0 ?        S    18:34   0:00 [jbd2/sda2-8]
root       218  0.0  0.0      0     0 ?        I<   18:34   0:00 [ext4-rsv-conver]
root       225  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/3:1H]
root       244  0.0  0.0      0     0 ?        I<   18:34   0:00 [kworker/2:1H]
root       245  0.0  0.5  96740 21084 ?        Ss   18:34   0:00 /usr/lib/systemd/systemd-journald
root       264  0.3  0.2  83624  8092 ?        Ss   18:34   0:00 /usr/lib/systemd/systemd-udevd
root       386  0.0  0.0      0     0 ?        S    18:34   0:00 [irq/34-mei_me]
root       416  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/0:3]
root       417  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/0:4]
root       418  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/0:5]
systemd+   425  0.0  0.1 150484  5392 ?        Ssl  18:35   0:00 /usr/lib/systemd/systemd-timesyncd
root       427  0.0  0.0      0     0 ?        I    18:35   0:00 [kworker/3:2]
dbus       431  0.1  0.1  32796  4104 ?        Ss   18:35   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root       436  0.1  0.4 461816 17352 ?        Ssl  18:35   0:00 /usr/bin/NetworkManager --no-daemon
root       438  0.0  0.1  66224  5732 ?        Ss   18:35   0:00 /usr/lib/systemd/systemd-logind
root       451  0.0  0.1 275460  7256 ?        Ssl  18:35   0:00 /usr/bin/lightdm
root       457  0.0  0.2 284908  8556 ?        Ssl  18:35   0:00 /usr/lib/accountsservice/accounts-daemon
polkitd    462  0.0  0.4 527416 17696 ?        Ssl  18:35   0:00 /usr/lib/polkit-1/polkitd --no-debug
dino       553  0.0  0.0  17052  1808 ?        S    18:35   0:00 sh /home/dino/.config/openbox/autostart
dino       589  0.0  0.5 656268 23288 ?        Ssl  18:35   0:00 mpd
rtkit      591  0.0  0.0 174808  2460 ?        SNsl 18:35   0:00 /usr/lib/rtkit-daemon
dino       621  0.0  0.2 143588  9876 ?        S    18:35   0:00 mpdas
root       665  0.7  1.1 443580 45460 tty7     Ssl+ 18:36   0:00 /usr/lib/xorg-server/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
root       671  0.0  0.1 239172  7624 ?        Sl   18:36   0:00 lightdm --session-child 17 20
lightdm    674  0.0  0.1  78624  7588 ?        Ss   18:36   0:00 /usr/lib/systemd/systemd --user
lightdm    675  0.0  0.0 288368  2092 ?        S    18:36   0:00 (sd-pam)
lightdm    681  0.7  1.6 720560 65356 ?        Ssl  18:36   0:00 /usr/bin/lightdm-gtk-greeter
lightdm    684  0.0  0.0  32244  3116 ?        Ss   18:36   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
lightdm    686  0.0  0.1 282452  6688 ?        Ssl  18:36   0:00 /usr/lib/gvfs/gvfsd
lightdm    691  0.0  0.1 348172  7888 ?        Sl   18:36   0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/620/gvfs -f -o big_writes
root       703  0.0  0.1 105704  5412 ?        S    18:36   0:00 lightdm --session-child 13 20
root       705  0.0  0.0  73372  3332 ?        Ss   18:36   0:00 login -- root
root       706  0.0  0.1  76392  7324 ?        Ss   18:36   0:00 /usr/lib/systemd/systemd --user
root       707  0.0  0.0 288368  2112 ?        S    18:36   0:00 (sd-pam)
root       713  0.0  0.0  19460  3968 tty2     Ss   18:36   0:00 -bash
root       722  0.0  0.0  30740  2876 tty2     R+   18:37   0:00 ps aux

As seen above, MPD is still running after I log out, but loginctl shows that my user is logged out.

For now I have settled for using systemd-run --user mpd from inside Openbox's startup script. It exits when I end the Openbox session and log out. I chose that over creating a proper systemd user service because I prefer keeping everything that gets started in 1 file, compared to having both the file start things and systemd.

I am still open for suggestions which would rely on Openbox alone though.

Offline

#4 2017-12-18 17:53:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: [SOLVED] MPD keeps running after logout

Ah, I misunderstood.  Openbox does some funny things with it's startup script.  I don't recall all of the steps, but I do remember that it's not just executed as a shell script.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB