A switch to disable checking if the service pid is in the correct cgroup
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
5c33fc5712
commit
e2ac26902c
11
ssm
11
ssm
|
@ -497,9 +497,12 @@ var service_reload_signal = 1
|
|||
var service_stop_signal = 15
|
||||
var service_cgroup_exclusive = 0 # Refuse to start the service if its cgroup is not empty
|
||||
var service_cgroup_wait = 0 # Wait on all the members of the cgroup to exit when stopping the service.
|
||||
|
||||
# Global config
|
||||
var systemd = 0 # Enable systemd-related functions.
|
||||
var systemd_service_path = /etc/systemd/system /run/systemd/system /lib/systemd/system
|
||||
var cgroups = 0 # Enable cgroup-related functions
|
||||
var cgroups_check_pid = 1 # Enable checking if the main service PID is in the correct cgroup before doing anythin with the service
|
||||
var usrdir = '/usr/share/ssm'
|
||||
|
||||
# These are not
|
||||
|
@ -581,9 +584,9 @@ else
|
|||
systemd && {
|
||||
for i in "${systemd_service_path[@]/%//$1.service}"; do
|
||||
[[ -f "$i" ]] && {
|
||||
var service_name = "$1"
|
||||
var service_systemd = 1
|
||||
var service_config = "$i"
|
||||
service_name = "$1"
|
||||
service_systemd = 1
|
||||
service_config = "$i"
|
||||
|
||||
read_systemd_service "$i"
|
||||
break
|
||||
|
@ -680,10 +683,12 @@ if cgroups; then
|
|||
fi
|
||||
|
||||
# If there's a service PID, check if it's in the service's cgroup
|
||||
if cgroups_check_pid; then
|
||||
if service_pid; then
|
||||
service_cgroup_procs u "$service_pid" || die 29 "Recorded service PID is not in the service's cgroup, bailing!"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if action is even defined
|
||||
is_function "$2" || die 17 "Function $2 is not defined for $service_name."
|
||||
|
|
6
ssm.conf
6
ssm.conf
|
@ -34,8 +34,14 @@
|
|||
# Enable cgroup-related functions
|
||||
#cgroups = 0
|
||||
|
||||
# Check if the recorded PID of the service is in the correct cgroup.
|
||||
# Only works with cgroups = 1
|
||||
#cgroups_check_pid = 1
|
||||
|
||||
# Refuse to start the service if its cgroup is not empty
|
||||
# Only works with cgroups = 1
|
||||
#service_cgroup_exclusive = 0
|
||||
|
||||
# Wait on all the members of the cgroup to exit when stopping the service.
|
||||
# Only works with cgroups = 1
|
||||
#service_cgroup_wait = 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user