views:

95

answers:

1

This is about the design decision and understand the procs and cons for adopting another service. So we have two services with two unrelated servers, one listening on port 10000 and another is a xinetd server responding 3 different requests via 3 different ports (its client uses nc server port1|port2|port3 to retrieve data).

One day because of the security issue, the xinetd server has to stop and just because the first server preserves the same data, we decided to adopt the xinetd server by sending USR1 signals to the first server and let it expose the same public data. Hence, there is a need to add logic to redefine the signal handling in the first server. We plan to use USR1 (10, 16, and 30) For example, in the xinetd server, kill -10 first_server will let the first server spit out the same data that the old server used to emit, and still dump to the first port. The argument is this is a bad design because it abuses the unix signal usage and of course redefined the POXIS and Linux pre-defined 10, 16, and 30 signum behavior. Is this really bad technically? What harm will make to the system?

+1  A: 

10 is SIGBUS, a bus error -- you probably shouldn't touch that one. 30 and 31 are SIGUSR1 and SIGUSR2, which are user-defined and not reserved for any particular purpose. 16 is SIGURG, urgent data on a socket, which you might not need, but it would be better to use the real-time signals above 31.

Dave
I see. That makes a lot sense. Is sending signal a good way to handling IPC in this case overall if we change to use unused signums?
jimx
Signals interrupt operations, which can be good (don't have to poll) and bad (have to check for errno == EINTR if you're going to try to handle signals). It's hard to say without knowing more about your app.
Dave
Our app is a rpc server, it handles SIGTERM (graceful stop, do some extra internal cleaning work) and SIGHUP (reload config and log) differently, other than that, all SIGs are used as sys defaults. One of the arguments is that signals should only be used to notify process to alter internal state instead of transferring info, in this case, its sort of like making a rpc call but the thing is we don't want to write the server to listen on extra three ports.
jimx