-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version without cgm and automatic child process removal
- Loading branch information
Showing
7 changed files
with
20 additions
and
128 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
exec sv -v h . |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
|
||
SVNAME="$(basename $0)" | ||
SVNAME="$(realpath $0 | cut -d/ -f4)" | ||
SVUSER="${SVNAME##*.}" | ||
|
||
cgm gettasksrecursive pids "$SVUSER" | xargs kill | ||
cgdelete -g "pids:users/${SVUSER}/runit" |
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
#!/bin/sh | ||
|
||
SVNAME="$(realpath $0 | cut -d/ -f4)" | ||
SVUSER=${SVNAME##*.} | ||
SVUSER="${SVNAME##*.}" | ||
SVHOME="$(eval "echo ~$SVUSER")/.local/service" | ||
|
||
who -u | grep -q "^$SVUSER" || exit 1 | ||
who | grep -q "^${SVUSER}" || exit 1 | ||
[ -d "$SVHOME" ] || exit 1 | ||
|
||
cgm create all "$SVUSER" | ||
cgm removeonempty all "$SVUSER" | ||
cgm setvalue pids "$SVUSER" pids.max 50 | ||
CGROUP="users/${SVUSER}/runit" | ||
|
||
exec 2>&1 | ||
exec cgexec -g "*:${SVUSER}" --sticky chpst -u "$SVUSER" -P runsvdir -P /home/"$SVUSER"/.local/service | ||
cgcreate -g "pids:$CGROUP" | ||
cgset -r pids.max=100 "$CGROUP" | ||
|
||
exec cgexec -g "pids:$CGROUP" --sticky -- chpst -u "$SVUSER" runsvdir "$SVHOME" |