# Extra post-upgrade for nosh-run-via-systemd
# vim: set filetype=sh:

# Re-apply presets to services that are cut-out by a special preset in this package.
system-control preset sysinit.target dbus.socket local-syslog.target
system-control preset static-networking.target
system-control preset remote-fs.target remote-fs-pre.target
system-control preset udev.socket udev-finish.service udev-log.service udev-settle.service udev-trigger-add@devices.service udev-trigger-add@subsystems.service
system-control preset busybox-mdev.socket busybox-mdev-log.service busybox-mdev-rescan.service
system-control preset suckless-mdev.socket suckless-mdev-log.service suckless-mdev-rescan.service
system-control preset mdevd.service mdevd-log.service mdevd-rescan.service
system-control preset vdev.socket vdev-log.service

# Create runtime directories that the system manager would normally create.
for i in service-manager system-manager terminal-emulator
do
	systemd-tmpfiles --create /usr/local/lib/tmpfiles.d/$i.conf
done

# Preset and start systemd service/socket/path units.
systemctl preset service-manager.socket
if systemctl is-enabled --quiet service-manager.socket 
then
	systemctl start --no-ask-password service-manager.socket
fi
systemctl preset system-control-normal.service
if systemctl is-enabled --quiet system-control-normal.service 
then
	systemctl start --no-ask-password system-control-normal.service
fi
systemctl preset service-manager-svscan.path
if systemctl is-enabled --quiet service-manager-svscan.path 
then
	systemctl start --no-ask-password service-manager-svscan.path
fi

true
