jjacky avatar jjacky committed d3fd064

kalu-updater: environment variables were unset, which could cause issues on some post_{install,upgrade} scripts, fixed

The sysupgrade is ran from kalu-dbus, which is automatically started through DBus. When starting something, DBus does clear all environment variables, which could cause problems is some scripts (e.g. mkinitcpio with autodetect hook, and the lack of a PATH defined).
This is fixed by using a bash script to source /etc/profile (and therefore restore a proper environment) before launching kalu-dbus (See https://bbs.archlinux.org/viewtopic.php?id=136784)

Comments (0)

Files changed (3)

 install:
 	install -D -m755 kalu $(DESTDIR)/usr/bin/kalu
 	install -D -m755 kalu-dbus $(DESTDIR)/usr/bin/kalu-dbus
+	install -D -m755 kalu-dbus-launcher $(DESTDIR)/usr/bin/kalu-dbus-launcher
 	install -D -m644 kalu.1.gz $(DESTDIR)/usr/share/man/man1/kalu.1.gz
 	install -D -m644 index.html $(DESTDIR)usr/share/doc/kalu/html/index.html
 	install -D -m644 arch_linux_48x48_icon_by_painlessrob.png $(DESTDIR)usr/share/pixmaps/kalu.png

kalu-dbus-launcher

+#!/bin/bash
+# we need to source /etc/profile to restore environment variables, most notably the PATH might be
+# required for some scripts ran during a sysupgrade (e.g. mkinitcpio on new kernel)
+. /etc/profile
+kalu-dbus

org.jjk.kalu.service

 [D-BUS Service]
 Name=org.jjk.kalu
-Exec=/usr/bin/kalu-dbus
+Exec=/usr/bin/kalu-dbus-launcher
 User=root
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.