summaryrefslogtreecommitdiffstats
path: root/remote/modules/rsyslogd/module.build
diff options
context:
space:
mode:
authorMichael Pereira Neves2014-03-31 21:14:19 +0200
committerMichael Pereira Neves2014-03-31 21:14:19 +0200
commitc68cfbfde55cf8565ba186dd60f2065e2269650a (patch)
tree6dbe7a31e0d943c968fad644f653effc903ae9b7 /remote/modules/rsyslogd/module.build
parent[brazilian] add brazilian locale and keymaps (diff)
parent[vbox] re-set permissions: openslx/script entries (diff)
downloadtm-scripts-c68cfbfde55cf8565ba186dd60f2065e2269650a.tar.gz
tm-scripts-c68cfbfde55cf8565ba186dd60f2065e2269650a.tar.xz
tm-scripts-c68cfbfde55cf8565ba186dd60f2065e2269650a.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/rsyslogd/module.build')
-rw-r--r--remote/modules/rsyslogd/module.build34
1 files changed, 34 insertions, 0 deletions
diff --git a/remote/modules/rsyslogd/module.build b/remote/modules/rsyslogd/module.build
new file mode 100644
index 00000000..c35d07b7
--- /dev/null
+++ b/remote/modules/rsyslogd/module.build
@@ -0,0 +1,34 @@
+fetch_source() {
+ :
+}
+
+build() {
+ COPYLIST="list_dpkg_output"
+ [ -e "$COPYLIST" ] && rm "$COPYLIST"
+
+ list_packet_files >> "$COPYLIST"
+ tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}"
+
+ return 0
+}
+
+post_copy() {
+
+
+ # pwd = module's build dir
+ mkdir -p "${TARGET_BUILD_DIR}"/var/spool/rsyslog
+
+ local RSL="$(find /usr/lib/ /lib/ -name rsyslog.service | head -1)"
+ [ -z "$RSL" -o ! -e "$RSL" ] && perror "rsyslog.service not found on vorlage"
+ [ ! -d "$TARGET_BUILD_DIR/etc/systemd/system" ] && mkdir -p "$TARGET_BUILD_DIR/etc/systemd/system"
+ cp -L "$RSL" "$TARGET_BUILD_DIR/etc/systemd/system/"
+ sed -i 's/\/bin\/systemctl/-\/usr\/bin\/systemctl/g' "${TARGET_BUILD_DIR}"/etc/systemd/system/rsyslog.service
+ sed -i 's/^Before=udev/#&/' "${TARGET_BUILD_DIR}"/etc/systemd/system/rsyslog.service
+
+ # activate the service
+ ln -sf rsyslog.service "${TARGET_BUILD_DIR}"/etc/systemd/system/syslog.service
+ [ ! -d "${TARGET_BUILD_DIR}"/etc/systemd/system/basic.target.wants ] && mkdir -p "${TARGET_BUILD_DIR}"/etc/systemd/system/basic.target.wants
+ ln -sf ../syslog.service "${TARGET_BUILD_DIR}"/etc/systemd/system/basic.target.wants/syslog.service
+ # TODO: more checks
+ sed -i.bak '/^After\=var-run.mount/d;/^Requires\=var-run.mount/d;/^Before\=syslog.target/d' "$TARGET_BUILD_DIR/etc/systemd/system/rsyslog.service"
+}