1 |
zx2c4 14/01/27 02:21:51 |
2 |
|
3 |
Modified: prosody.initd |
4 |
Added: prosody-0.9.2-cfg.lua.patch prosody.initd.old |
5 |
Log: |
6 |
Version bump and rework init system. |
7 |
|
8 |
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key A5DE03AE) |
9 |
|
10 |
Revision Changes Path |
11 |
1.3 net-im/prosody/files/prosody.initd |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/prosody/files/prosody.initd?rev=1.3&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/prosody/files/prosody.initd?rev=1.3&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/prosody/files/prosody.initd?r1=1.2&r2=1.3 |
16 |
|
17 |
Index: prosody.initd |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/net-im/prosody/files/prosody.initd,v |
20 |
retrieving revision 1.2 |
21 |
retrieving revision 1.3 |
22 |
diff -u -r1.2 -r1.3 |
23 |
--- prosody.initd 27 Nov 2012 09:20:26 -0000 1.2 |
24 |
+++ prosody.initd 27 Jan 2014 02:21:51 -0000 1.3 |
25 |
@@ -1,15 +1,12 @@ |
26 |
#!/sbin/runscript |
27 |
-# Copyright 1999-2012 Gentoo Foundation |
28 |
+# Copyright 1999-2014 Gentoo Foundation |
29 |
# Distributed under the terms of the GNU General Public License v2 |
30 |
-# $Header: /var/cvsroot/gentoo-x86/net-im/prosody/files/prosody.initd,v 1.2 2012/11/27 09:20:26 klausman Exp $ |
31 |
+# $Header: /var/cvsroot/gentoo-x86/net-im/prosody/files/prosody.initd,v 1.3 2014/01/27 02:21:51 zx2c4 Exp $ |
32 |
|
33 |
description="Prosody is a server for Jabber/XMPP written in Lua." |
34 |
description_reload="Reload configuration and reopen log files." |
35 |
extra_started_commands="reload" |
36 |
- |
37 |
-PIDFILE="/var/run/jabber/prosody.pid" |
38 |
-USER="jabber" |
39 |
-COMMAND="/usr/bin/prosody" |
40 |
+pidfile="/var/run/jabber/prosody.pid" |
41 |
|
42 |
depend() { |
43 |
use dns |
44 |
@@ -22,26 +19,28 @@ |
45 |
eerror "You need a /etc/jabber/prosody.cfg.lua file to run prosody" |
46 |
return 1 |
47 |
fi |
48 |
+ luac -p /etc/jabber/prosody.cfg.lua |
49 |
+ return $? |
50 |
} |
51 |
|
52 |
start() { |
53 |
checkconfig || return 1 |
54 |
checkpath -q -d -m 0770 -o jabber:jabber /var/run/jabber |
55 |
+ checkpath -q -d -m 0750 -o jabber:jabber /var/log/jabber |
56 |
ebegin "Starting Prosody XMPP Server" |
57 |
- start-stop-daemon --start -b --pidfile ${PIDFILE} \ |
58 |
- --make-pidfile --user ${USER} --exec ${COMMAND} |
59 |
+ prosodyctl start |
60 |
eend $? |
61 |
} |
62 |
|
63 |
stop() { |
64 |
ebegin "Stopping Prosody XMPP Server" |
65 |
- start-stop-daemon --stop --pidfile ${PIDFILE} \ |
66 |
- --user ${USER} --exec ${COMMAND} |
67 |
+ prosodyctl stop |
68 |
eend $? |
69 |
} |
70 |
|
71 |
reload() { |
72 |
+ checkconfig || return 1 |
73 |
ebegin "Reloading configuration of Prosody XMPP Server" |
74 |
- start-stop-daemon --pidfile ${PIDFILE} --signal HUP |
75 |
+ prosodyctl reload |
76 |
eend $? |
77 |
} |
78 |
|
79 |
|
80 |
|
81 |
1.1 net-im/prosody/files/prosody-0.9.2-cfg.lua.patch |
82 |
|
83 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/prosody/files/prosody-0.9.2-cfg.lua.patch?rev=1.1&view=markup |
84 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/prosody/files/prosody-0.9.2-cfg.lua.patch?rev=1.1&content-type=text/plain |
85 |
|
86 |
Index: prosody-0.9.2-cfg.lua.patch |
87 |
=================================================================== |
88 |
diff -ru prosody-0.9.2/prosody.cfg.lua.dist prosody-0.9.2-gentoo/prosody.cfg.lua.dist |
89 |
--- prosody-0.9.2/prosody.cfg.lua.dist 2013-12-08 19:05:39.000000000 +0100 |
90 |
+++ prosody-0.9.2-gentoo/prosody.cfg.lua.dist 2014-01-27 03:00:44.929196948 +0100 |
91 |
@@ -1,5 +1,3 @@ |
92 |
--- Prosody Example Configuration File |
93 |
--- |
94 |
-- Information on configuring Prosody can be found on our |
95 |
-- website at http://prosody.im/doc/configure |
96 |
-- |
97 |
@@ -7,9 +5,6 @@ |
98 |
-- when you have finished by running: luac -p prosody.cfg.lua |
99 |
-- If there are any errors, it will let you know what and where |
100 |
-- they are, otherwise it will keep quiet. |
101 |
--- |
102 |
--- The only thing left to do is rename this file to remove the .dist ending, and fill in the |
103 |
--- blanks. Good luck, and happy Jabbering! |
104 |
|
105 |
|
106 |
---------- Server-wide settings ---------- |
107 |
@@ -63,7 +58,7 @@ |
108 |
--"http_files"; -- Serve static files from a directory over HTTP |
109 |
|
110 |
-- Other specific functionality |
111 |
- --"posix"; -- POSIX functionality, sends server to background, enables syslog, etc. |
112 |
+ "posix"; -- POSIX functionality, sends server to background, enables syslog, etc. (Keep enabled for Gentoo.) |
113 |
--"groups"; -- Shared roster support |
114 |
--"announce"; -- Send announcement to all online users |
115 |
--"welcome"; -- Welcome users who register accounts |
116 |
@@ -72,6 +67,12 @@ |
117 |
--"legacyauth"; -- Legacy authentication. Only used by some old clients and bots. |
118 |
}; |
119 |
|
120 |
+-- Settings for Gentoo init script and net-im/jabber-base permissions system: |
121 |
+daemonize = true; |
122 |
+prosody_user = "jabber"; |
123 |
+prosody_group = "jabber"; |
124 |
+pidfile = "/var/run/jabber/prosody.pid"; |
125 |
+ |
126 |
-- These modules are auto-loaded, but should you want |
127 |
-- to disable them then uncomment them here: |
128 |
modules_disabled = { |
129 |
@@ -139,8 +140,8 @@ |
130 |
-- Logging configuration |
131 |
-- For advanced logging see http://prosody.im/doc/logging |
132 |
log = { |
133 |
- info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging |
134 |
- error = "prosody.err"; |
135 |
+ info = "/var/log/jabber/prosody.log"; -- Change 'info' to 'debug' for verbose logging |
136 |
+ error = "/var/log/jabber/prosody.err"; |
137 |
-- "*syslog"; -- Uncomment this for logging to syslog |
138 |
-- "*console"; -- Log to the console, useful for debugging with daemonize=false |
139 |
} |
140 |
|
141 |
|
142 |
|
143 |
1.1 net-im/prosody/files/prosody.initd.old |
144 |
|
145 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/prosody/files/prosody.initd.old?rev=1.1&view=markup |
146 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/prosody/files/prosody.initd.old?rev=1.1&content-type=text/plain |
147 |
|
148 |
Index: prosody.initd.old |
149 |
=================================================================== |
150 |
#!/sbin/runscript |
151 |
# Copyright 1999-2014 Gentoo Foundation |
152 |
# Distributed under the terms of the GNU General Public License v2 |
153 |
# $Header: /var/cvsroot/gentoo-x86/net-im/prosody/files/prosody.initd.old,v 1.1 2014/01/27 02:21:51 zx2c4 Exp $ |
154 |
|
155 |
description="Prosody is a server for Jabber/XMPP written in Lua." |
156 |
description_reload="Reload configuration and reopen log files." |
157 |
extra_started_commands="reload" |
158 |
|
159 |
PIDFILE="/var/run/jabber/prosody.pid" |
160 |
USER="jabber" |
161 |
COMMAND="/usr/bin/prosody" |
162 |
|
163 |
depend() { |
164 |
use dns |
165 |
need net |
166 |
provide jabber-server |
167 |
} |
168 |
|
169 |
checkconfig() { |
170 |
if [ ! -e /etc/jabber/prosody.cfg.lua ] ; then |
171 |
eerror "You need a /etc/jabber/prosody.cfg.lua file to run prosody" |
172 |
return 1 |
173 |
fi |
174 |
} |
175 |
|
176 |
start() { |
177 |
checkconfig || return 1 |
178 |
checkpath -q -d -m 0770 -o jabber:jabber /var/run/jabber |
179 |
ebegin "Starting Prosody XMPP Server" |
180 |
start-stop-daemon --start -b --pidfile ${PIDFILE} \ |
181 |
--make-pidfile --user ${USER} --exec ${COMMAND} |
182 |
eend $? |
183 |
} |
184 |
|
185 |
stop() { |
186 |
ebegin "Stopping Prosody XMPP Server" |
187 |
start-stop-daemon --stop --pidfile ${PIDFILE} \ |
188 |
--user ${USER} --exec ${COMMAND} |
189 |
eend $? |
190 |
} |
191 |
|
192 |
reload() { |
193 |
ebegin "Reloading configuration of Prosody XMPP Server" |
194 |
start-stop-daemon --pidfile ${PIDFILE} --signal HUP |
195 |
eend $? |
196 |
} |