summaryrefslogtreecommitdiff
path: root/jaildaemon.sh
blob: 52098ed9460d8246be309c8fbc2bb4fc24335513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

echo Need a running jail with jid 1 for this test. Enter to proceed
read a

killall jaildaemon
./jaildaemon -D

# daemon comes back too fast, so uds is not yet open
sleep 1
./jaildaemon -j 1 -c '/usr/bin/touch /foo' -t Schnupsi -r

echo -n "Killing (respawnin) task: "
pgrep -f Schnupsi

pkill -HUP -f Schnupsi
sleep 1

echo "Yielding file, touched by task:"
ls -al /foo

echo "Deleting file"
rm -r /foo

echo
echo -n "New task id: "
pgrep -f Schnupsi

echo "Killing with normal signal:"

pkill -f Schnupsi
sleep 1

echo "Expecting no file here:"
ls -al /foo

echo "Also expecting no command to match:"
pgrep -f Schnupsi