summaryrefslogtreecommitdiff
path: root/jaildaemon.sh
blob: 0741c230531d3c1de38f8da9b41d0684f7a86833 (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
#!/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

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

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

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