Closed Paxa closed 9 years ago
According to https://github.com/thuehlinger/daemons/blob/master/lib/daemons/pidfile.rb
Daemons is configurable to store the Pid-Files relative to three different locations:
Nice. Can you give an example how to make in /opt/pids/my-app.pid
?
Daemons.daemonize(:dir => '/opt/pids')
But how to make pidfile name not same with application name?
Daemons.daemonize(:app_name => 'custom_app_name', :dir => '/opt/pids')
@Paxa or @thuehlinger I think this question is answered and can be closed.
I still can't make different name for process and pid file.
for example process name my_daemon
, and pid_file daemon_process.pid
As I see in source code it use same name for pid and proces name
You can set the sub process name in the sub process itself, like this:
Daemons.run_proc('pid_file_name') do
# Set the process name
$0 = 'my_fancy_process'
# Do whatever as a daemon
end
When I run it, it only create file in current folder. How to change it to
/var/run/app.pid
or any other folder?