Skip to content

Commit

Permalink
runpod.sh: set systemd only if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Oct 10, 2024
1 parent 677b6c8 commit c3c1591
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions daemontools-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
03. supervise.c: use service dir as first argument for ./run, ./alert and
./shutdown
04. svps: use .svscan.pid from service directory of each svscan instance
- 10/10/2024
05. runpod.sh: set systemd only if not set

* Tue Aug 06 2024 12:48:42 +0000 Manvendra Bhangui <daemontools@indimail.org> 1.1.5-1.1%{?dist}
Release 1.1.5-1.1 Start 05/02/2024 End 06/08/2024
Expand Down
25 changes: 17 additions & 8 deletions daemontools-x/runpod.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: runpod.sh,v 1.10 2022-12-08 09:40:09+05:30 Cprogrammer Exp mbhangui $
# $Id: runpod.sh,v 1.11 2024-10-10 21:15:18+05:30 Cprogrammer Exp mbhangui $
#
usage()
{
Expand Down Expand Up @@ -95,7 +95,7 @@ set_defaults()
vol_args="$vol_args-v /home/$command/mail:/home/mail "
fi
if [ " $name" = " devel" -a -d /usr/local/src ] ; then
vol_args="$vol_args-v /usr/local/src:/usr/local/src"
vol_args="$vol_args-v /usr/local/src:/usr/local/src "
fi
fi
if [ " $name" = " devel" -o " $name" = " test" ] ; then
Expand Down Expand Up @@ -211,18 +211,24 @@ if [ $# -gt 0 -a "$1" = "auto" ] ; then
tag=`$command images | grep $imageid | awk '{print $2}'`
case $tag in
xenial*|debian*|focal*|bionic*|archlinux*|ubi*)
systemd=/lib/systemd/systemd
if [ -z "$systemd" ] ; then
systemd=/lib/systemd/systemd
fi
;;
alpine*|gentoo*)
systemd="/sbin/init"
if [ -z "$systemd" ] ; then
systemd="/sbin/init"
fi
;;
*)
systemd=/usr/lib/systemd/systemd
if [ -z "$systemd" ] ; then
systemd=/usr/lib/systemd/systemd
fi
;;
esac
if [ -n "$systemd" ] ; then
set "$systemd $*"
fi
fi
if [ -n "$systemd" ] ; then
set "$systemd $*"
fi
echo "$command run $cgroup $extra_args"
echo " --publish-all --name $name"
Expand Down Expand Up @@ -267,6 +273,9 @@ fi

#
# $Log: runpod.sh,v $
# Revision 1.11 2024-10-10 21:15:18+05:30 Cprogrammer
# set systemd if not set
#
# Revision 1.10 2022-12-08 09:40:09+05:30 Cprogrammer
# fixed setting of systemd
#
Expand Down

0 comments on commit c3c1591

Please sign in to comment.