Currently process name is 'lua', though I'm sure it is possible to change
at runtime, need to look into it.
MattJ
on
Removing milestone, this apparently can't be done in any sensible way, but still...
Changes
tagsMilestone-0.4.1
google@dbb.io
on
I don't know if you've considered this or how feasible it is, but how about a small
wrapper written in C whose only purpose is to load the Lua interpreter and execute
the main prosody script? The C wrapper could then be /usr/bin/prosody and what's
/usr/bin/prosody now could be /usr/lib/prosody/core/main.lua or something like that.
Having a unique process name would certainly make writing daemon scripts easier.
google@dbb.io
on
I've been toying around with that last idea and came up with the file attached. It's
basically just a copy n' paste from an embedded Lua guide but it seems to work as far
as starting the server and having it accept connections. My testing went as far as
running it on my laptop, creating two accounts, and having them talk to each other.
I'm sure it would have to be more complex to handle things like POSIX signals, etc.
but it seems like a workable solution since Prosody already has some components
written in C, correct?
A cheap way for Linux could be also to overwrite '/proc/self/cmdline' with the expected result, like $0 in Perl is doing. But as said, this is highly system dependent.
Currently process name is 'lua', though I'm sure it is possible to change at runtime, need to look into it.
Removing milestone, this apparently can't be done in any sensible way, but still...
ChangesMilestone-0.4.1I don't know if you've considered this or how feasible it is, but how about a small wrapper written in C whose only purpose is to load the Lua interpreter and execute the main prosody script? The C wrapper could then be /usr/bin/prosody and what's /usr/bin/prosody now could be /usr/lib/prosody/core/main.lua or something like that. Having a unique process name would certainly make writing daemon scripts easier.
I've been toying around with that last idea and came up with the file attached. It's basically just a copy n' paste from an embedded Lua guide but it seems to work as far as starting the server and having it accept connections. My testing went as far as running it on my laptop, creating two accounts, and having them talk to each other. I'm sure it would have to be more complex to handle things like POSIX signals, etc. but it seems like a workable solution since Prosody already has some components written in C, correct?
AttachmentsA cheap way for Linux could be also to overwrite '/proc/self/cmdline' with the expected result, like $0 in Perl is doing. But as said, this is highly system dependent.
There's this module https://modules.prosody.im/mod_proctitle.html now. (I thought someone had already mentioned that here) /proc/self/cmdline appears read-only on my systems?