Commit Graph

13 Commits

Author SHA1 Message Date
ArenM
89c8e5cae8 sxmo_daemons: only run one process at a time
There seems to be a race somewhere in sxmo_demons that can cause it to
spawn multiple copies of a task. This patch does the equivalent of using
sxmo_uniq_exec, but it doesn't require changing all the calls to
sxmo_daemons.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-02-16 09:12:40 +01:00
Tzafrir Cohen
4a15176782 GNU find: -mindepth should come before -exec
Fixes: find: warning: you have specified the global option -mindepth
after the argument -exec, but global options are not positional, i.e.,
 -mindepth affects tests specified before it as well as those specified
after it.  Please specify global options before other arguments.

Originally busybox find was used and it probably does not give this
warning.

Signed-off-by: Tzafrir Cohen <tzafrir@debian.org>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-12-05 11:46:42 -08:00
Stacy Harper
a2405f6d57 Fix shellspec 2022-11-15 13:41:55 +01:00
Peter John Hartman
6a960bca34 daemons: pipe kills to null
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-10-22 20:04:00 -04:00
Stacy Harper
8b1e08cd37 fixup! WIP: change from sxmo_daemons.sh to superd for 'most' 'daemons' 2022-04-16 11:11:13 +02:00
Anjandev Momi
6f52863501 Switch to superd for daemons we want to monitor
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-04-16 11:11:10 +02:00
Anjandev Momi
1123c0f072 Change license to AGPL-3.0-only 2022-03-15 08:00:00 -04:00
Peter John Hartman
85baef7915 debug statements
I changed the sxmo_log calls in sxmo_daemons.sh to sxmo_debug, and I
added some sxmo_debug statements in inputhandlers and in check mutex.
These messages are useful for debug but not normal users.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 14:17:28 +01:00
Stacy Harper
07c5bbeac6 Use common logging methods instead 2022-01-29 11:43:18 +01:00
Stacy Harper
ae3af41616 Refresh wayout/conky on screen lock/unlock
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-01-29 11:35:35 +01:00
Peter John Hartman
18f0fa9149 Add sxmo_log and sxmo_debug functions
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-01-24 21:03:30 +01:00
Peter John Hartman
1f7ec79705 sxmo_daemons: add logging
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-01-17 13:42:11 +01:00
Stacy Harper
d32bc7e02e Refact: Daemons management
Add a sxmo_daemons to manage all sxmo daemons

$ sxmo_daemons.sh start mmsd mmsdtng
$ sxmo_daemons.sh start network_monitor sxmo_networkmonitor.sh
$ sxmo_daemons.sh start sleepy sleep 2

$ sxmo_daemons.sh start network_monitor sxmo_networkmonitor.sh
-> This will stop the old daemon and start a new one

$ sxmo_daemons.sh running network_monitor
network_monitor is still running
$ echo $?
0

$ sxmo_daemons.sh running unknown
unknown is not running
$ echo $?
1

$ sxmo_daemons.sh running sleepy
sleepy is not running anymore
$ echo $?
2

$ sxmo_daemons.sh running network_monitor -q && echo "tada !"
tada !

$ sxmo_daemons.sh stop network_monitor
$ sxmo_daemons.sh stop all # to stop every managed daemons

We can now start, stop and check daemons status with ease. When
dwm/sway shutdown, we stop all daemons. Restarting or toggleing window
manager cannot leave any dangling daemons anymore.

As you can see, all daemons now start from the start hook. We gave the
full power on the user to disable or add daemons.

This patch is painfull cause I had to make sure every daemons behave
correctly and shutdown gracefully when killed (which was definitely not
the case !).

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2022-01-15 11:30:49 +01:00