Subversion Repositories ALCASAR

Rev

Rev 3170 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 3170 Rev 3190
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-daemon.sh 3170 2024-02-22 17:28:40Z rexy $
2
# $Id: alcasar-daemon.sh 3190 2024-04-07 22:35:03Z rexy $
3
 
3
 
4
# alcasar-daemon.sh
4
# alcasar-daemon.sh
5
# by Franck BOUIJOUX & Rexy
5
# by Franck BOUIJOUX & Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
# Watchdog of Services
7
# Watchdog of Services
Line 42... Line 42...
42
		exit 0
42
		exit 0
43
		;;
43
		;;
44
	-after-update)
44
	-after-update)
45
		# TODO : check precisely which processes should be restarted (reboot the system or restart alcasar processes)
45
		# TODO : check precisely which processes should be restarted (reboot the system or restart alcasar processes)
46
		# extract processes name : for i in `dnf needs-restarting|cut -d " " -f3|sort -u|tr -d ":"|rev|cut -d"/" -f1|rev`;do;echo $i;done
46
		# extract processes name : for i in `dnf needs-restarting|cut -d " " -f3|sort -u|tr -d ":"|rev|cut -d"/" -f1|rev`;do;echo $i;done
47
		# system_processes=`dnf needs-restarting|egrep 'dbus|python|systemd|agetty'|wc -l` # processes to be restarted after glibc update 
47
		# system_processes=`dnf needs-restarting|grep -E 'dbus|python|systemd|agetty'|wc -l` # processes to be restarted after glibc update 
48
		nb_processes=`dnf needs-restarting|wc -l`
48
		nb_processes=`dnf needs-restarting|wc -l`
49
		if [ $nb_processes -ne 0 ]; then
49
		if [ $nb_processes -ne 0 ]; then
50
			reboot
50
			reboot
51
		fi
51
		fi
52
		;;
52
		;;