2015-02-05 03:14:41 +01:00
|
|
|
#!/bin/bash
|
2010-04-05 20:58:57 +02:00
|
|
|
#
|
|
|
|
# chkconfig: 345 90 90
|
2016-10-22 17:43:16 +02:00
|
|
|
# description: Executes supplementary Qubes core scripts at VM boot
|
2010-04-05 20:58:57 +02:00
|
|
|
#
|
|
|
|
# Source function library.
|
2017-09-30 04:56:02 +02:00
|
|
|
# shellcheck disable=SC1091
|
2010-04-05 20:58:57 +02:00
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
# Source Qubes library.
|
2017-09-30 04:56:02 +02:00
|
|
|
# shellcheck source=init/functions
|
2016-10-22 17:43:16 +02:00
|
|
|
. /usr/lib/qubes/init/functions
|
|
|
|
|
2010-04-05 20:58:57 +02:00
|
|
|
start()
|
|
|
|
{
|
2016-10-22 17:43:16 +02:00
|
|
|
have_qubesdb || return
|
2015-04-22 08:04:10 +02:00
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
# Start AppVM specific services
|
|
|
|
for svc in cups ntpd ; do
|
|
|
|
if qsvc $svc && test -e /etc/init.d/$svc ; then
|
|
|
|
/sbin/service $svc start
|
2015-04-22 08:04:10 +02:00
|
|
|
fi
|
2016-10-22 17:43:16 +02:00
|
|
|
done
|
2011-03-31 15:15:10 +02:00
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
echo -n $"Finagling printer icon:"
|
|
|
|
/usr/lib/qubes/init/control-printer-icon.sh
|
2010-04-05 20:58:57 +02:00
|
|
|
success
|
2016-10-22 17:43:16 +02:00
|
|
|
echo
|
|
|
|
|
|
|
|
if qsvc meminfo-writer ; then
|
|
|
|
MEM_CHANGE_THRESHOLD_KB=30000
|
|
|
|
MEMINFO_DELAY_USEC=100000
|
|
|
|
echo -n $"Starting Qubes memory information service:"
|
|
|
|
/usr/lib/qubes/meminfo-writer $MEM_CHANGE_THRESHOLD_KB $MEMINFO_DELAY_USEC /var/run/meminfo-writer.pid
|
|
|
|
success
|
|
|
|
echo ""
|
2011-06-26 18:57:46 +02:00
|
|
|
fi
|
2016-10-22 17:43:16 +02:00
|
|
|
|
|
|
|
echo -n $"Executing Qubes misc post scripts:"
|
2017-09-30 04:49:21 +02:00
|
|
|
# shellcheck disable=SC2015
|
2016-10-22 17:43:16 +02:00
|
|
|
/usr/lib/qubes/init/misc-post.sh && success || failure
|
|
|
|
echo
|
2010-04-05 20:58:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
2016-10-22 17:43:16 +02:00
|
|
|
have_qubesdb || return
|
|
|
|
|
|
|
|
/usr/lib/qubes/init/misc-post-stop.sh
|
2010-04-05 20:58:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop}"
|
|
|
|
exit 3
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2017-09-30 04:49:21 +02:00
|
|
|
# shellcheck disable=SC2086
|
2010-04-05 20:58:57 +02:00
|
|
|
exit $RETVAL
|