mirror of https://github.com/cutefishos/appmotor
Merge branch 'jb42038' into 'master'
[mapplauncherd] Add booster cgroup mount service. Fixes MER#1916 See merge request mer-core/mapplauncherd!9pull/1/head
commit
db11a3a532
@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Booster cgroup mounting service
|
||||
Before=systemd-user-sessions.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/lib/startup/booster-cgroup-mount
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
CGDIR="/sys/fs/cgroup"
|
||||
|
||||
# precondition: cgroup mount must exist
|
||||
mountpoint -q $CGDIR || exit 1
|
||||
|
||||
# create booster directory
|
||||
if [ ! -d $CGDIR/booster ]; then
|
||||
FAIL=1
|
||||
if mount -o remount,rw $CGDIR; then
|
||||
if mkdir $CGDIR/booster; then
|
||||
FAIL=0
|
||||
fi
|
||||
if ! mount -o remount,ro $CGDIR; then
|
||||
FAIL=1
|
||||
fi
|
||||
fi
|
||||
[ $FAIL = 0 ] || exit 1
|
||||
fi
|
||||
|
||||
# mount booster directory
|
||||
if ! mountpoint -q $CGDIR/booster; then
|
||||
mount -t cgroup -o none,name=booster cgroup $CGDIR/booster || exit 1
|
||||
fi
|
||||
|
||||
# adjust booster directory permissions
|
||||
FAIL=0
|
||||
chown -R root:privileged $CGDIR/booster || FAIL=1
|
||||
chmod 0774 $CGDIR/booster || FAIL=1
|
||||
exit $FAIL
|
||||
Loading…
Reference in New Issue