-
Notifications
You must be signed in to change notification settings - Fork 0
/
os_dummy-systemd
95 lines (80 loc) · 2.8 KB
/
os_dummy-systemd
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Summary: Dummy package to fix systemd initscripts configs
Name: vzdummy-systemd-f23
Group: Applications/System
Vendor: Parallels
License: GPL
Version: 1.0
Release: 1
Autoreq: 0
BuildRoot: %_tmppath/%name-root
BuildArch: noarch
Obsoletes: vzdummy-systemd-fc22
%description
Dummy package to fix systemd initscripts configs
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/default.target.wants
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/reboot.target.wants
cat >> $RPM_BUILD_ROOT/usr/lib/systemd/system/vzfifo.service << EOL
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
[Unit]
Description=Tell that Container is started
ConditionPathExists=/proc/vz
ConditionPathExists=!/proc/bc
After=multi-user.target quotaon.service quotacheck.service
[Service]
Type=forking
ExecStart=/bin/touch /.vzfifo
TimeoutSec=0
RemainAfterExit=no
SysVStartPriority=99
EOL
ln -s /usr/lib/systemd/system/vzfifo.service \
$RPM_BUILD_ROOT/etc/systemd/system/default.target.wants/vzfifo.service
ln -s /usr/lib/systemd/system/quotaon.service \
$RPM_BUILD_ROOT/etc/systemd/system/default.target.wants/quotaon.service
ln -s /usr/lib/systemd/system/quotaon.service \
$RPM_BUILD_ROOT/etc/systemd/system/default.target.wants/quotacheck.service
cat >> $RPM_BUILD_ROOT/usr/lib/systemd/system/vzreboot.service << EOL
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
[Unit]
Description=Tell that Container is rebooted
ConditionPathExists=/proc/vz
ConditionPathExists=!/proc/bc
Before=systemd-reboot.service
DefaultDependencies=no
[Service]
Type=forking
ExecStart=/bin/touch /reboot
TimeoutSec=0
RemainAfterExit=no
EOL
ln -s /usr/lib/systemd/system/vzreboot.service \
$RPM_BUILD_ROOT/lib/systemd/system/reboot.target.wants/vzreboot.service
%triggerin -- iputils
# Clear cap_net_admin capability from pings
for file in "/bin/ping" "/bin/ping6"; do
setcap cap_net_raw+ep $file > /dev/null 2>&1
done
:
%files
%attr(0644, root, root) /usr/lib/systemd/system/vzfifo.service
%attr(0644, root, root) /usr/lib/systemd/system/vzreboot.service
/etc/systemd/system/default.target.wants/quotacheck.service
/etc/systemd/system/default.target.wants/quotaon.service
/etc/systemd/system/default.target.wants/vzfifo.service
/lib/systemd/system/reboot.target.wants/vzreboot.service
%changelog
* Tue Jun 09 2015 Konstantin Volckov <wolf@odin.com> 1.0-1
- created