File: systemdintegration

package info (click to toggle)
apache2 2.4.66-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 59,324 kB
  • sloc: ansic: 212,315; python: 13,830; perl: 11,307; sh: 7,254; php: 1,320; javascript: 1,314; awk: 749; makefile: 715; lex: 374; yacc: 161; xml: 2
file content (78 lines) | stat: -rwxr-xr-x 2,106 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash

# test systemd intregation
set -eux

RC=0
fail () {
	echo "FAIL: $@" >&2
	RC=1
}


function exit_handler()
{
    systemctl status apache2.service || true
    systemctl stop apache2 || true
    cat /var/log/apache2/error.log || true
    cat /var/log/apache2/access.log || true
    exit 1
}
trap exit_handler EXIT

systemctl start apache2 ||systemctl restart apache2
systemctl is-active --quiet apache2
systemctl status apache2
wget -S -q --output-document - "http://localhost/" | head
systemctl reset-failed apache2
systemctl reload apache2
systemctl is-active --quiet apache2
systemctl status apache2
wget -S -q --output-document - "http://localhost/" | head
systemctl reset-failed apache2
systemctl restart apache2
systemctl is-active --quiet apache2
systemctl status apache2
wget -S -q --output-document - "http://localhost/" | head
systemctl reset-failed apache2
systemctl stop apache2
! systemctl is-active --quiet apache2
! systemctl status apache2
! ( wget -S -q --output-document - "http://localhost/" | head)
systemctl reset-failed apache2
systemctl start apache2 || systemctl restart apache2
systemctl is-active --quiet apache2
systemctl status apache2
wget -S -q --output-document - "http://localhost/" | head
systemctl reset-failed apache2
systemctl stop apache2
! systemctl is-active --quiet apache2

# now apachectl wrapper
systemctl reset-failed apache2
apachectl start
systemctl is-active --quiet apache2
systemctl status apache2
wget -S -q --output-document - "http://localhost/" | head
systemctl reset-failed apache2
apachectl graceful
systemctl is-active --quiet apache2
systemctl status apache2
wget -S -q --output-document - "http://localhost/" | head
systemctl reset-failed apache2
apachectl restart
systemctl is-active --quiet apache2
systemctl status apache2
wget -S -q --output-document - "http://localhost/" | head
systemctl reset-failed apache2
apachectl graceful-stop
! systemctl is-active --quiet apache2
! systemctl status apache2
! ( wget -S -q --output-document - "http://localhost/" | head)
systemctl reset-failed apache2
apachectl start

trap - EXIT

exit 0