#89 Set process name to 'prosody' when running

Reporter MattJ
Owner MattJ
Stars ★★ (3)
  • Status-Fixed
  • Type-Enhancement
  • Priority-Medium
  • Component-Community
  • OpSys-OSX
  • OpSys-Linux
  1. MattJ on

    Currently process name is 'lua', though I'm sure it is possible to change at runtime, need to look into it.

  2. MattJ on

    Removing milestone, this apparently can't be done in any sensible way, but still...

    • tags Milestone-0.4.1
  3. 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.

  4. 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?

  5. Robert Scheck on

    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.

  6. Zash on

    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?

  7. Zash on

    • tags Component-Community Status-Fixed

New comment

Not published. Used for spam prevention and optional update notifications.