wake up scripting

Kernels & Hardware, configuring network, installing services

Re: wake up scripting

Postby kmchen » 2017-12-29 17:30

Sorry to come back with that thread but it worked a few days and failed after a while. Reboot or system upgrade ? I don't know.

I recall my simplified script:
Code: Select all
cat /lib/systemd/system-sleep/kmc_reload_sound
#!/bin/bash
#

pid=$(pgrep -xn pulseaudio)\
  && export DBUS_SESSION_BUS_ADDRESS="$(grep -ao -m1 -P '(?<=DBUS_SESSION_BUS_ADDRESS=).*?\0' /proc/"$pid"/environ)"

#sudo -i -u kmc pulseaudio --kill
logger kmc_v2
sudo -i -u kmc cadence-session-start -s
logger kmc_v2_end
#sudo -i -u kmc pulseaudio --start
#sudo -i -u kmc /usr/sbin/alsactl restore

sudo -i -u kmc /usr/bin/play /usr/share/sounds/Kopete_Event.ogg


And I get that in syslog after a wake up from sleep:
Dec 29 18:40:44 kmcs logger: kmc_v2
Dec 29 18:40:49 kmcs pulseaudio[1893]: JACK error >Cannot connect to server request channel<
Dec 29 18:40:50 kmcs pulseaudio[1893]: JACK error >Cannot connect to server socket err = Connexion refusée<
Dec 29 18:40:51 kmcs pulseaudio[1893]: JACK error >jack server is not running or cannot be started<
Dec 29 18:40:51 kmcs pulseaudio[1893]: jack_client_open() failed.
Dec 29 18:40:51 kmcs pulseaudio[1893]: Failed to load module "module-jack-source" (argument: ""): initialization failed.
Dec 29 18:40:51 kmcs pulseaudio[1893]: Module load failed.
Dec 29 18:40:51 kmcs pulseaudio[1893]: Échec lors de l'initialisation du démon
Dec 29 18:40:52 kmcs org.jackaudio.service[1542]: no message buffer overruns
Dec 29 18:40:52 kmcs systemd-sleep[1860]: tryCloseJackDBus() failed
Dec 29 18:40:52 kmcs systemd-sleep[1860]: Traceback (most recent call last):
Dec 29 18:40:52 kmcs systemd-sleep[1860]: File "/usr/share/cadence/src/cadence_session_start.py", line 236, in <module>
Dec 29 18:40:52 kmcs systemd-sleep[1860]: sys.exit(startSession(False, False))
Dec 29 18:40:52 kmcs systemd-sleep[1860]: File "/usr/share/cadence/src/cadence_session_start.py", line 67, in startSession
Dec 29 18:40:52 kmcs systemd-sleep[1860]: DBus.bus = dbus.SessionBus()
Dec 29 18:40:52 kmcs systemd-sleep[1860]: File "/usr/lib/python3/dist-packages/dbus/_dbus.py", line 211, in __new__
Dec 29 18:40:52 kmcs systemd-sleep[1860]: mainloop=mainloop)
Dec 29 18:40:52 kmcs systemd-sleep[1860]: File "/usr/lib/python3/dist-packages/dbus/_dbus.py", line 100, in __new__
Dec 29 18:40:52 kmcs systemd-sleep[1860]: bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
Dec 29 18:40:52 kmcs systemd-sleep[1860]: File "/usr/lib/python3/dist-packages/dbus/bus.py", line 122, in __new__
Dec 29 18:40:52 kmcs systemd-sleep[1860]: bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
Dec 29 18:40:52 kmcs systemd-sleep[1860]: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Dec 29 18:40:52 kmcs logger: kmc_v2_end


DBUS exception again. :oops:

Thanks for your help to have a linux sound system 100% working one day !

I just want to launch the simple command
Code: Select all
cadence-session-start -s
that works perfectly when I have X11 workin after resume from sleep.
Développeur WEB
http://www.webologix.com
kmchen
 
Posts: 25
Joined: 2013-04-24 06:29

Re: wake up scripting

Postby kmchen » 2018-01-04 17:39

Any body there ?
Développeur WEB
http://www.webologix.com
kmchen
 
Posts: 25
Joined: 2013-04-24 06:29

Previous

Return to System configuration

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable