beanstalkd.init still uses -d flag #100

Closed
tomponline opened this Issue Feb 13, 2012 · 5 comments

Projects

None yet

3 participants

@tomponline

Hi,

The example init script in beanstalkd is still using -d flag.

Line 64 of adm/sysv/beanstalkd.init

@tomponline

Any update on how beanstalkd should be started on CentOS/RedHat without a process manager?

@kr kr closed this in beefa83 Apr 21, 2012
@keen99
keen99 commented May 1, 2012

boggle. so your solution here was to just delete the init.d script because it's your belief that init.d shouldn't be used? brilliant.

I'm a strong supporter of having processes be capable of running without being daemonized (I'm talking to you apache httpd), but there are plenty of valid cases -to- daemonize as well.

@keen99 keen99 pushed a commit to keen99/beanstalkd that referenced this issue May 1, 2012
david raistrick Revert "remove obsolete startup method; closes #100"
This reverts commit beefa83.
e9b8240
@keen99
keen99 commented May 1, 2012

updated init.d scripts are at https://github.com/keen99/beanstalkd/tree/master/adm/sysv

works around the missing -d flag, and addresses an issue I've frequently encountered with stop/restart where -INT is sent instead of -TERM then -KILL - should make stop and restart more reliable.

I'll generate a pull request in case kr is interested.

@kr
Owner
kr commented May 1, 2012

Any update on how beanstalkd should be started on CentOS/RedHat without a process manager?

CentOS and Red Hat come with a process manager; its configuration file
is /etc/inittab. You can find brief instructions for using it at the bottom of
https://github.com/kr/beanstalkd/blob/master/adm/Readme

However, init.d scripts, especially when combined with processes that
fork, are a terrible way to run services. I'm not going to encourage such
an unreliable mechanism.

@tomponline

Terrible seems a bit of an exaggeration seeing as it has worked for me flawlessly for beanstalkd for several years in production, as well as other packages such as Apache, MySQL, Redis, Memcached etc. The alternative way of running beanstalkd from the inittab file has maintenance issues itself; it is non-standard in that the /sbin/service command cannot be used to restart it, the /etc/inittab file is global, so it cannot be modified reliably by package managers when adding/removing beanstalkd as an RPM whereas just dropping an init script into /etc/init.d would suffice with the standard way, popular config managers such as puppet cannot ensure the service is running or configured to run on system, as it uses the /sbin/service tool to check the processes status.

By all means recommend against using the -d flag in the documentation, but seeing as the feature was there and working great, it seems a great shame to remove it when there is no proper alternative in RedHat based systems.

@d3mcfadden d3mcfadden added a commit to CompendiumSoftware/beanstalkd that referenced this issue Apr 2, 2013
@d3mcfadden d3mcfadden Revert "remove obsolete startup method; closes #100"
This reverts commit beefa83.
56c4b17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment