summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Rößler2013-09-18 15:48:44 +0200
committerChristian Rößler2013-09-18 15:48:44 +0200
commit8f35360d250b77d8a88519832a9e87cadf7246ca (patch)
treec586397a1ded0ffba4b70de893a4cb9d5e59f278
parent[blacklists] Modifications for accounts-daemon.service (diff)
parent...better yet, make it optional (diff)
downloadtm-scripts-8f35360d250b77d8a88519832a9e87cadf7246ca.tar.gz
tm-scripts-8f35360d250b77d8a88519832a9e87cadf7246ca.tar.xz
tm-scripts-8f35360d250b77d8a88519832a9e87cadf7246ca.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
-rw-r--r--remote/modules/dbus/data/etc/systemd/system/dbus.socket5
l---------remote/modules/dbus/data/etc/systemd/system/multi-user.target.wants/dbus.service1
l---------remote/modules/dbus/data/etc/systemd/system/sockets.target.wants/dbus.socket1
-rw-r--r--remote/modules/dbus/dbus.build21
-rw-r--r--remote/modules/dbus/dbus.conf.opensuse5
-rw-r--r--remote/modules/dbus/dbus.conf.ubuntu4
-rw-r--r--remote/modules/dbus/templates/dbus.service12
-rw-r--r--remote/modules/debug/debug.conf2
-rwxr-xr-xremote/setup_target11
9 files changed, 45 insertions, 17 deletions
diff --git a/remote/modules/dbus/data/etc/systemd/system/dbus.socket b/remote/modules/dbus/data/etc/systemd/system/dbus.socket
new file mode 100644
index 00000000..5c373cf4
--- /dev/null
+++ b/remote/modules/dbus/data/etc/systemd/system/dbus.socket
@@ -0,0 +1,5 @@
+[Unit]
+Description=D-Bus System Message Bus Socket
+
+[Socket]
+ListenStream=/run/dbus/system_bus_socket
diff --git a/remote/modules/dbus/data/etc/systemd/system/multi-user.target.wants/dbus.service b/remote/modules/dbus/data/etc/systemd/system/multi-user.target.wants/dbus.service
new file mode 120000
index 00000000..224df24b
--- /dev/null
+++ b/remote/modules/dbus/data/etc/systemd/system/multi-user.target.wants/dbus.service
@@ -0,0 +1 @@
+../dbus.service \ No newline at end of file
diff --git a/remote/modules/dbus/data/etc/systemd/system/sockets.target.wants/dbus.socket b/remote/modules/dbus/data/etc/systemd/system/sockets.target.wants/dbus.socket
new file mode 120000
index 00000000..fe02d162
--- /dev/null
+++ b/remote/modules/dbus/data/etc/systemd/system/sockets.target.wants/dbus.socket
@@ -0,0 +1 @@
+../dbus.socket \ No newline at end of file
diff --git a/remote/modules/dbus/dbus.build b/remote/modules/dbus/dbus.build
index bcab63b0..7b7e472c 100644
--- a/remote/modules/dbus/dbus.build
+++ b/remote/modules/dbus/dbus.build
@@ -7,11 +7,26 @@ fetch_source() {
build() {
COPYLIST="list_dpkg_output"
[ -e "${COPYLIST}" ] && rm "${COPYLIST}"
-
- list_packet_files >> "${COPYLIST}"
+
+ list_packet_files >> "${COPYLIST}"
tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}"
-
+
+ # Generate systemd files
+ mkdir -p "$MODULE_BUILD_DIR/etc/systemd/system"
+ local UUIDGEN=$(find "$MODULE_BUILD_DIR" -name dbus-uuidgen -executable | head -n 1)
+ local DAEMON=$(find "$MODULE_BUILD_DIR" -name dbus-daemon -executable | head -n 1)
+ local SEND=$(find "$MODULE_BUILD_DIR" -name dbus-send -executable | head -n 1)
+ UUIDGEN="${UUIDGEN#$MODULE_BUILD_DIR}"
+ DAEMON="${DAEMON#$MODULE_BUILD_DIR}"
+ SEND="${SEND#$MODULE_BUILD_DIR}"
+ [ -z "$UUIDGEN" ] && perror "Could not determine dbus-uuidgen location"
+ [ -z "$DAEMON" ] && perror "Could not determine dbus-daemon location"
+ [ -z "$SEND" ] && perror "Could not determine dbus-send location"
+ sed "s,%UUIDGEN%,/$UUIDGEN,g;s,%DAEMON%,/$DAEMON,g;s,%SEND%,/$SEND,g" "templates/dbus.service" \
+ > "$MODULE_BUILD_DIR/etc/systemd/system/dbus.service" \
+ || perror "Could not generate $MODULE_BUILD_DIR/etc/systemd/system/dbus.service"
}
post_copy() {
:
}
+
diff --git a/remote/modules/dbus/dbus.conf.opensuse b/remote/modules/dbus/dbus.conf.opensuse
index 93610f62..9bc514e2 100644
--- a/remote/modules/dbus/dbus.conf.opensuse
+++ b/remote/modules/dbus/dbus.conf.opensuse
@@ -1,7 +1,4 @@
REQUIRED_CONTENT_PACKAGES="
dbus-1
"
-REQUIRED_DIRECTORIES+="
- /usr/lib/systemd
-"
-REQUIRED_FILES=""
+
diff --git a/remote/modules/dbus/dbus.conf.ubuntu b/remote/modules/dbus/dbus.conf.ubuntu
index d007c2ef..9f302876 100644
--- a/remote/modules/dbus/dbus.conf.ubuntu
+++ b/remote/modules/dbus/dbus.conf.ubuntu
@@ -1,9 +1,7 @@
REQUIRED_CONTENT_PACKAGES="
dbus
"
-REQUIRED_DIRECTORIES+="
- /lib/systemd
-"
REQUIRED_FILES="
/etc/default/dbus
"
+
diff --git a/remote/modules/dbus/templates/dbus.service b/remote/modules/dbus/templates/dbus.service
new file mode 100644
index 00000000..a49d8f0f
--- /dev/null
+++ b/remote/modules/dbus/templates/dbus.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=D-Bus System Message Bus
+Wants=dbus.socket
+Requires=dbus.socket
+After=syslog.target
+
+[Service]
+ExecStartPre=%UUIDGEN% --ensure
+ExecStartPre=-/bin/rm -f /run/dbus/pid
+ExecStart=%DAEMON% --system --address=systemd: --nofork --activation=systemd
+ExecReload=%SEND% --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
+OOMScoreAdjust=-900
diff --git a/remote/modules/debug/debug.conf b/remote/modules/debug/debug.conf
index 82a741fe..71006514 100644
--- a/remote/modules/debug/debug.conf
+++ b/remote/modules/debug/debug.conf
@@ -12,7 +12,7 @@ REQUIRED_BINARIES="
su
file
@htop
- logger
+ @logger
@tcpdump
getfacl
"
diff --git a/remote/setup_target b/remote/setup_target
index 04af2158..00a182f3 100755
--- a/remote/setup_target
+++ b/remote/setup_target
@@ -358,13 +358,12 @@ process_module() {
post_process_target() {
local TOOL_STR="$TOOL_STR post_process_target:"
- # move systemd files from /lib to /etc/lib
- pinfo "move systemd files from /lib/systemd to /etc/systemd"
if [ -d "${TARGET_BUILD_DIR}/lib/systemd" ]; then
- cd "${TARGET_BUILD_DIR}/lib"
- tarcopy "systemd" "${TARGET_BUILD_DIR}/etc"
- cd - &> /dev/null
- rm -r "${TARGET_BUILD_DIR}/lib/systemd"
+ pwarning "/lib/systemd exists in the generated target. It is not advisable to fetch existing"
+ pwarning "systemd service files from the template system, as it might conflict with generated"
+ pwarning "ones. In fact, some systems don't even use systemd so there might be no existing"
+ pwarning "service files. Please generate your own service file and place it in /etc/systemd."
+ pwarning "All files in /lib/systemd will be ignored."
fi
# figure out all relevant ld-paths