-
-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72d99a1
commit df14958
Showing
6 changed files
with
45 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,9 +36,6 @@ BOOT_BERRYBOOT=$(grep -m1 -c '\(/var/media\|/media/pi\)/berryboot' /etc/mtab) | |
#get current system ip | ||
NET_IP=`hostname -I | cut -d " " -f1` | ||
|
||
# search for users in system, returns first entry | ||
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root" | ||
|
||
START_MSG="" | ||
|
||
# service registration if no gui is present (only on initial installation and not upgrade) | ||
|
@@ -50,6 +47,7 @@ if [ "$IS_UPGRADE" = false ]; then | |
then | ||
# systemd | ||
echo "---> init deamon: systemd" | ||
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root" | ||
install_file /usr/share/hyperion/service/hyperion.systemd /etc/systemd/system/[email protected] | ||
systemctl enable hyperion"@${FOUND_USR}".service | ||
START_MSG="--> systemctl start hyperion for user ${FOUND_USR}" | ||
|
@@ -78,6 +76,11 @@ else | |
if [ -z "${DISPLAY}" ] && [ -z "${WAYLAND_DISPLAY}" ] && [ -z "${XDG_CURRENT_DESKTOP}" ]; then | ||
#cleanup service files also on upgrade (non gui user) | ||
rm -r /usr/share/hyperion/service 2>/dev/null | ||
#start existing service on upgrade | ||
CURRENT_SERVICE=$(systemctl list-units --all | { grep -o "hyperion*.*\.service" || true; }) | ||
if [ ! -z ${CURRENT_SERVICE} ]; then | ||
systemctl start "${CURRENT_SERVICE}" | ||
fi | ||
fi | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ if [ "$2" = "in-favour" ]; then | |
fi | ||
|
||
# Don't clean-up just for an upgrade.` | ||
if [ "$action" = "upgrade" ] ; then | ||
if [ "$UPGRADE" = "upgrade" ] ; then | ||
exit 0 | ||
fi | ||
|
||
|
@@ -22,27 +22,33 @@ pgrep hyperiond > /dev/null 2>&1 && HYPERION_RUNNING=true | |
|
||
if grep -m1 systemd /proc/1/comm > /dev/null | ||
then | ||
echo "---> stop init deamon: systemd" | ||
# systemd | ||
$HYPERION_RUNNING && systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null | ||
echo "---> stop init deamon: systemd" | ||
CURRENT_SERVICE=$(systemctl list-units --all | { grep -o "hyperion*.*\.service" || true; }) | ||
if [ ! -z ${CURRENT_SERVICE} ]; then | ||
$HYPERION_RUNNING && systemctl stop "${CURRENT_SERVICE}" 2> /dev/null | ||
systemctl -q disable "${CURRENT_SERVICE}" 2> /dev/null | ||
else | ||
$HYPERION_RUNNING && systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null | ||
systemctl -q disable hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null | ||
fi | ||
# disable user specific symlink | ||
echo "---> Disable service and remove entry" | ||
systemctl -q disable hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null | ||
rm -v /etc/systemd/system/hyperion.service /etc/systemd/system/[email protected] /etc/systemd/system/[email protected] 2> /dev/null | ||
|
||
elif [ -e /sbin/initctl ] | ||
then | ||
echo "---> stop init deamon: upstart" | ||
# upstart | ||
echo "---> stop init deamon: upstart" | ||
$HYPERION_RUNNING && initctl stop hyperiond | ||
$HYPERION_RUNNING && initctl stop hyperion | ||
echo "---> Remove upstart service" | ||
rm -v /etc/init/hyperion* 2>/dev/null | ||
initctl reload-configuration | ||
|
||
else | ||
echo "---> stop init deamon: sysV" | ||
# sysV | ||
echo "---> stop init deamon: sysV" | ||
$HYPERION_RUNNING && service hyperiond stop 2> /dev/null | ||
$HYPERION_RUNNING && service hyperion stop 2> /dev/null | ||
echo "---> Remove sysV service" | ||
|