+ /* If the anaconda process is now being restarted, we need to do some
+ * environment cleanup first.
+ */
+ restart_anaconda(&loaderData);
+
+ if (!access("/var/run/loader.run", R_OK)) {
+ printf(_("loader has already been run. Starting shell.
"));
+ execl("/bin/sh", "-/bin/sh", NULL);
+ doExit(0);
+ }
+
+ f = fopen("/var/run/loader.run", "w+");
+ fprintf(f, "%d
", getpid());
+ fclose(f);
+
logMessage(INFO, "anaconda version %s on %s starting", VERSION, getProductArch());
RESTART_FILE=/tmp/restart_anaconda
-ANACONDA_PID=`cat /var/run/anaconda.pid`
-
-descendants() {
- PID=$1
- DIRECT=`ps --ppid $PID -o pid=`
- INDIRECT='
- for child in $DIRECT; do
- INDIRECT+=' '`descendants $child`
- done
- # prepend grandchildren, we are goingt to kill them first
- DESCENDANTS=$INDIRECT' '$DIRECT
- echo $DESCENDANTS
-}
-
-anaconda_descendants() {
- descendants $ANACONDA_PID
-}
# this is how loader knows it should restart stuff.
# it will also delete the file once the restart is in progress.
touch $RESTART_FILE
-# kill all anaconda descendants and anaconda itself
-RESTART_VICTIMS=`anaconda_descendants`
-RESTART_VICTIMS+=' '$ANACONDA_PID
if [[ -f /var/run/iscsid.pid ]]; then
# iscsid must die else it will cause us troubles on the next run
- RESTART_VICTIMS+=' '`cat /var/run/iscsid.pid`
# log out of all nodes
/sbin/iscsiadm -m node --logoutall=all
fi
-echo "killing processes: " $RESTART_VICTIMS
-for child in $RESTART_VICTIMS; do
- kill -s KILL $child &>/dev/null
-done
+
+# This will kill all programs in the loader group and restart the
+# service.
+systemctl restart loader.service
--
1.7.4.1
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list