You are not logged in.
Take this simple dispatcher script:
#!/bin/bash
INTERFACE=$1 # The interface which is brought up or down
STATUS=$2 # The new state of the interface
case "$STATUS" in
up) # $INTERFACE is up
su -c "DISPLAY=:0 dropboxd &" orschiro
;;
down) # $INTERFACE is down
;;
esac
All it does is to start dropbox daemon after a successful connection. The result is, however, that the dropbox tray icon appears for ~3 seconds before it disappears again.
A zombie process remains:
~ $ ps aux | grep dropbox
orschiro 779 0.0 0.0 0 0 tty1 Z Okt29 0:23 [dropbox] <defunct>
Any idea why this is happening?
Last edited by orschiro (2013-11-04 11:44:55)
Offline
Why don't you use systemd to keep track of the daemon, instead of (failing to properly) orphan it?
systemctl start dropbox@orschiro.service
Offline
I used to use the systemd dispatcher but sometimes encounter that the tray icon is not showing up correctly. Thus I wanted to test it with the (old) method and see if the problem remains the same.
Offline
It happens because NM-dispatcher is for short-lived scripts and there is a 3 sec timeout, which you have witnessed in your first post. https://bugzilla.redhat.com/show_bug.cgi?id=982734
Offline
@Strike0
Thanks for the report! I was never aware of that 3 seconds rule.
Is there any way for me to measure how long it takes to launch ` su -c "DISPLAY=:0 dropboxd &" orschiro`?
Then I can be certainly sure and seek for ways how to improve the script run time.
Offline
Maybe prepend "time" to the script command. But the problem may not be the script, but the dispatcher which gets 'cleaned' up after 3 secs leaving you the zombie. I had a similar problem and read somewhere that modding the dispatcher service by adding "RemainAFterExit=" might help, but still have to try that.
Offline
Nice one!
I added `RemainAfterExit=Yes` to `/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service` and so far my dispatcher script has not been killed!
I will test it a bit though before being too optimistic about it.
~ $ cat /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
[Unit]
Description=Network Manager Script Dispatcher Service
[Service]
Type=dbus
BusName=org.freedesktop.nm_dispatcher
ExecStart=/usr/lib/networkmanager/nm-dispatcher.action
RemainAfterExit=yes
[Install]
Alias=dbus-org.freedesktop.nm-dispatcher.service
Offline
After having tested it more deeply, I can confirm that it is proven workaround.
I created a respective Wiki section for it: https://wiki.archlinux.org/index.php/Ne … ds_timeout
Offline