Running and managing two daemons with same executable by rc together

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I use FreeBSD UNIX and its rc system of startup scripts to make my Node.js servers start at reboot as a daemon and start, as daemon again, and stop them with some commands the system gives me after I logged in to my FreeBSD UNIX user account.
I have read the Handbook related sections and an article on it, and I have written the following script, and the config, in /etc/rc.d/my_script and /etc.rc.conf, respectively. Which make it work as I described. When I another script for another service only one of them work, I think usually the second one.
my_script_1 is executable for all as '-rwxr-xr-x'.
/etc/rc.d/my_script:
#!/bin/sh
. /etc/rc.subr
name=my_service_1
rcvar=$name_enable
project_dir="/usr/home/ec2-user/dev/projects/my_project_1"
command="/usr/local/bin/node"
command_args="$project_dir/index.js"
load_rc_config $name
run_rc_command "$1"
/etc.rc.conf includes enabling var set:
my_service_1_enable="YES"
When I add another script and rc.conf entry like those with just name changed to a different name like, my_service_2, only one of them works. my_script_2 is executable as well.
What am I missing? How can I make them work both?
freebsd daemon rc
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
I use FreeBSD UNIX and its rc system of startup scripts to make my Node.js servers start at reboot as a daemon and start, as daemon again, and stop them with some commands the system gives me after I logged in to my FreeBSD UNIX user account.
I have read the Handbook related sections and an article on it, and I have written the following script, and the config, in /etc/rc.d/my_script and /etc.rc.conf, respectively. Which make it work as I described. When I another script for another service only one of them work, I think usually the second one.
my_script_1 is executable for all as '-rwxr-xr-x'.
/etc/rc.d/my_script:
#!/bin/sh
. /etc/rc.subr
name=my_service_1
rcvar=$name_enable
project_dir="/usr/home/ec2-user/dev/projects/my_project_1"
command="/usr/local/bin/node"
command_args="$project_dir/index.js"
load_rc_config $name
run_rc_command "$1"
/etc.rc.conf includes enabling var set:
my_service_1_enable="YES"
When I add another script and rc.conf entry like those with just name changed to a different name like, my_service_2, only one of them works. my_script_2 is executable as well.
What am I missing? How can I make them work both?
freebsd daemon rc
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I use FreeBSD UNIX and its rc system of startup scripts to make my Node.js servers start at reboot as a daemon and start, as daemon again, and stop them with some commands the system gives me after I logged in to my FreeBSD UNIX user account.
I have read the Handbook related sections and an article on it, and I have written the following script, and the config, in /etc/rc.d/my_script and /etc.rc.conf, respectively. Which make it work as I described. When I another script for another service only one of them work, I think usually the second one.
my_script_1 is executable for all as '-rwxr-xr-x'.
/etc/rc.d/my_script:
#!/bin/sh
. /etc/rc.subr
name=my_service_1
rcvar=$name_enable
project_dir="/usr/home/ec2-user/dev/projects/my_project_1"
command="/usr/local/bin/node"
command_args="$project_dir/index.js"
load_rc_config $name
run_rc_command "$1"
/etc.rc.conf includes enabling var set:
my_service_1_enable="YES"
When I add another script and rc.conf entry like those with just name changed to a different name like, my_service_2, only one of them works. my_script_2 is executable as well.
What am I missing? How can I make them work both?
freebsd daemon rc
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I use FreeBSD UNIX and its rc system of startup scripts to make my Node.js servers start at reboot as a daemon and start, as daemon again, and stop them with some commands the system gives me after I logged in to my FreeBSD UNIX user account.
I have read the Handbook related sections and an article on it, and I have written the following script, and the config, in /etc/rc.d/my_script and /etc.rc.conf, respectively. Which make it work as I described. When I another script for another service only one of them work, I think usually the second one.
my_script_1 is executable for all as '-rwxr-xr-x'.
/etc/rc.d/my_script:
#!/bin/sh
. /etc/rc.subr
name=my_service_1
rcvar=$name_enable
project_dir="/usr/home/ec2-user/dev/projects/my_project_1"
command="/usr/local/bin/node"
command_args="$project_dir/index.js"
load_rc_config $name
run_rc_command "$1"
/etc.rc.conf includes enabling var set:
my_service_1_enable="YES"
When I add another script and rc.conf entry like those with just name changed to a different name like, my_service_2, only one of them works. my_script_2 is executable as well.
What am I missing? How can I make them work both?
freebsd daemon rc
freebsd daemon rc
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 mins ago
Ià Âñk
1011
1011
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Ià Âñk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ià Âñk is a new contributor. Be nice, and check out our Code of Conduct.
Ià Âñk is a new contributor. Be nice, and check out our Code of Conduct.
Ià Âñk is a new contributor. Be nice, and check out our Code of Conduct.
Ià Âñk is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476589%2frunning-and-managing-two-daemons-with-same-executable-by-rc-together%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password