coolexp / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

Please add option to daemonise (and write to pid to pidfile, etc.) #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For 1.0, I wonder if you could implement--as an option--to double-fork(2)
etc. and write the new pid to a file specified in the config file.

This makes writing init scripts much less error-prone, as not only do we
not need to use a helper utility to fork(2) for us, we can actually detect
whether redis-server started successfully by testing for contents of the
pidfile.

I understand that redis is in beta, but it would certainly be nice to have
this for 1.0. I could prepare a patch for this; let me know if that would
be helpful.

Original issue reported on code.google.com by ChrisLam...@gmail.com on 8 Mar 2009 at 2:52

GoogleCodeExporter commented 8 years ago
The title of this bug should be, of course, "write pid to pidfile". Sorry for 
not
proof-reading.

Original comment by ChrisLam...@gmail.com on 8 Mar 2009 at 2:52

GoogleCodeExporter commented 8 years ago
Hello! Sure I already had plans to do so, I'll just leave it as an option on the
configuration file, something along the line 'daemonize yes', with the default 
being
'no'. The idea is that it is much more user friendly to test for the first time
something that instead to disappear continues to evidently run and output error
messages to the standard output :)

Original comment by anti...@gmail.com on 8 Mar 2009 at 8:33

GoogleCodeExporter commented 8 years ago
The solution you outline would be perfect, thanks; and I agree that making it 
not
daemonize by default is more friendly.

Oh, can I request chuid(2) support too? Can send a patch if it would be helpful.

Chris

Original comment by ChrisLam...@gmail.com on 11 Mar 2009 at 10:02

GoogleCodeExporter commented 8 years ago
Done for the first part "daemonize option". Today I'll add "user <username>" 
option
that chuid to the specified user. Pid file writing is also in the TODO list.

Original comment by anti...@gmail.com on 12 Mar 2009 at 9:16

GoogleCodeExporter commented 8 years ago
Just use daemontools.

Original comment by or.else....@gmail.com on 14 Mar 2009 at 3:37

GoogleCodeExporter commented 8 years ago
No; that's sub-optimal in many ways (and it's not as if the feature is 
difficult to add).

Original comment by ChrisLam...@gmail.com on 14 Mar 2009 at 11:00

GoogleCodeExporter commented 8 years ago
No, it's not difficult to add this feature.  I'm curious why using daemontools 
is
sub-optimal?  I've only worked with it a few times so I might be missing 
something. 
Thanks.

Original comment by or.else....@gmail.com on 26 Mar 2009 at 2:23

GoogleCodeExporter commented 8 years ago

Original comment by anti...@gmail.com on 7 Apr 2009 at 11:01