aboutsummaryrefslogtreecommitdiffstats
path: root/community/kiwiirc/kiwilauncher.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/kiwiirc/kiwilauncher.patch')
-rw-r--r--community/kiwiirc/kiwilauncher.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/community/kiwiirc/kiwilauncher.patch b/community/kiwiirc/kiwilauncher.patch
new file mode 100644
index 0000000000..cdc8545963
--- /dev/null
+++ b/community/kiwiirc/kiwilauncher.patch
@@ -0,0 +1,24 @@
+index a1f1208..47770b6 100644
+--- a/server/helpers/launcher.js
++++ b/server/helpers/launcher.js
+@@ -1,5 +1,5 @@
+ var kiwi_app = '../kiwi.js';
+-var pidfile = '../../kiwiirc.pid';
++var pidfile = '/run/kiwiirc/kiwiirc.pid';
+ var pidfile_arg;
+
+ // Check if a pidfile has been set as an argument
+@@ -16,6 +16,13 @@ if (process.argv.indexOf('-p') > -1) {
+ }
+ }
+
++try {
++ process.setgid('kiwiirc');
++ process.setuid('kiwiirc');
++} catch (e) {
++ console.error('Cannot switch to user kiwiirc. Try running as root.')
++ process.exit();
++}
+
+ var daemon = require('daemonize2').setup({
+ main: kiwi_app,