-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathdeploy.sh
More file actions
79 lines (73 loc) · 2.2 KB
/
deploy.sh
File metadata and controls
79 lines (73 loc) · 2.2 KB
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
#!/bin/sh
# Linux Deploy Component
# (c) Anton Skshidlevsky <meefik@gmail.com>, GPLv3
do_install()
{
msg ":: Installing ${COMPONENT} ... "
local packages=""
case "${DISTRIB}:${ARCH}:${SUITE}" in
debian:*|ubuntu:*|kalilinux:*)
packages="dbus"
apt_install ${packages}
;;
archlinux:*)
packages="dbus"
pacman_install ${packages}
;;
fedora:*)
packages="dbus"
dnf_install ${packages}
;;
centos:*)
packages="dbus"
yum_install ${packages}
;;
gentoo:*)
packages="sys-apps/dbus"
emerge_install ${packages}
;;
esac
}
do_configure()
{
msg ":: Configuring ${COMPONENT} ... "
make_dirs /run/dbus /var/run/dbus
chmod 644 "${CHROOT_DIR}/etc/machine-id"
chroot_exec -u root dbus-uuidgen > "${CHROOT_DIR}/etc/machine-id"
case "${DISTRIB}:${ARCH}:${SUITE}" in
archlinux:*)
local user_names="systemd-timesync systemd-network colord systemd-resolve polkitd avahi dbus"
for username in ${user_names}
do
chroot_exec -u root groupadd -f ${username}
chroot_exec -u root useradd -g ${username} -s /bin/false -d / ${username}
done
chroot_exec -u root groupadd -f network
;;
esac
return 0
}
do_start()
{
msg -n ":: Starting ${COMPONENT} ... "
is_stopped /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid
is_ok "skip" || return 0
remove_files /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid
chroot_exec -u root dbus-daemon --system --fork
is_ok "fail" "done"
return 0
}
do_stop()
{
msg -n ":: Stopping ${COMPONENT} ... "
kill_pids /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid
is_ok "fail" "done"
return 0
}
do_status()
{
msg -n ":: ${COMPONENT} ... "
is_started /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid
is_ok "stopped" "started"
return 0
}