From 3957962cf9bd1062a683e765521518f70d79ee8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 26 Mar 2008 16:42:57 +0000 Subject: [PATCH] BitlBee: Run as `bitlbee' instead of `root'. svn path=/nixos/trunk/; revision=11292 --- system/ids.nix | 1 + system/options.nix | 2 +- upstart-jobs/bitlbee.nix | 22 ++++++++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/system/ids.nix b/system/ids.nix index 73fa8c8a0bb1..b0ce6e28591e 100644 --- a/system/ids.nix +++ b/system/ids.nix @@ -24,6 +24,7 @@ haldaemon = 5; vsftpd = 7; ftp = 8; + bitlbee = 9; avahi = 10; portmap = 11; audio = 17; diff --git a/system/options.nix b/system/options.nix index f62bcd82d8db..f8d3e302e722 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1042,7 +1042,7 @@ }; portNumber = mkOption { - default = "6667"; + default = 6667; description = '' Number of the port BitlBee will be listening to. ''; diff --git a/upstart-jobs/bitlbee.nix b/upstart-jobs/bitlbee.nix index b28d3d055612..d9956230aa07 100644 --- a/upstart-jobs/bitlbee.nix +++ b/upstart-jobs/bitlbee.nix @@ -1,17 +1,27 @@ args: with args; + +let + bitlbeeUid = (import ../system/ids.nix).uids.bitlbee; +in { name = "bitlbee"; users = [ { name = "bitlbee"; - uid = (import ../system/ids.nix).uids.bitlbee; + uid = bitlbeeUid; description = "BitlBee user"; home = "/var/empty"; } ]; - job = " -description \"BitlBee IRC to other chat networks gateway\" + groups = [ + { name = "bitlbee"; + gid = (import ../system/ids.nix).gids.bitlbee; + } + ]; + + job = '' +description "BitlBee IRC to other chat networks gateway" start on network-interfaces/started stop on network-interfaces/stop @@ -23,8 +33,8 @@ start script fi end script -# FIXME: Eventually we want to use inetd instead of using `-F'. -respawn ${bitlbee}/sbin/bitlbee -F -p ${portNumber} -i ${interface} - "; +respawn ${bitlbee}/sbin/bitlbee -F -p ${toString portNumber} \ + -i ${interface} -u bitlbee + ''; }