Run two init.d scripts in one command [closed]











up vote
1
down vote

favorite












I’m trying to combine two init.d scripts to start two services at one.



Current:



$. service name1 start 
$. service name2 start


Need:



$. service name3 start 


Where name3 = name1 + name2










share|improve this question









New contributor




Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as unclear what you're asking by Christopher, Scott, RalfFriedl, schily, Jesse_b Nov 21 at 16:04


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • What do you wish to happen if service name1 or name2 fails at startup? Should name3 still start the other service, or make sure both services will always be at the same state, i.e. either both running or both stopped, but never just one of the two alone?
    – telcoM
    Nov 20 at 21:59










  • I want both to be running at the same state. If name1 doesn’t start for any reason then name2 shouldn’t either.
    – Syed Q
    Nov 20 at 22:27










  • Is this on CentOS 7? Or an older version? They're different, since CentOS 7 ships systemd...
    – Filipe Brandenburger
    Nov 21 at 0:15










  • You could create a new script that has: service name1 start && service name2 start From man bash: The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.
    – kevlinux
    Nov 21 at 2:29












  • This is on centos 6
    – Syed Q
    Nov 21 at 6:41















up vote
1
down vote

favorite












I’m trying to combine two init.d scripts to start two services at one.



Current:



$. service name1 start 
$. service name2 start


Need:



$. service name3 start 


Where name3 = name1 + name2










share|improve this question









New contributor




Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as unclear what you're asking by Christopher, Scott, RalfFriedl, schily, Jesse_b Nov 21 at 16:04


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • What do you wish to happen if service name1 or name2 fails at startup? Should name3 still start the other service, or make sure both services will always be at the same state, i.e. either both running or both stopped, but never just one of the two alone?
    – telcoM
    Nov 20 at 21:59










  • I want both to be running at the same state. If name1 doesn’t start for any reason then name2 shouldn’t either.
    – Syed Q
    Nov 20 at 22:27










  • Is this on CentOS 7? Or an older version? They're different, since CentOS 7 ships systemd...
    – Filipe Brandenburger
    Nov 21 at 0:15










  • You could create a new script that has: service name1 start && service name2 start From man bash: The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.
    – kevlinux
    Nov 21 at 2:29












  • This is on centos 6
    – Syed Q
    Nov 21 at 6:41













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I’m trying to combine two init.d scripts to start two services at one.



Current:



$. service name1 start 
$. service name2 start


Need:



$. service name3 start 


Where name3 = name1 + name2










share|improve this question









New contributor




Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I’m trying to combine two init.d scripts to start two services at one.



Current:



$. service name1 start 
$. service name2 start


Need:



$. service name3 start 


Where name3 = name1 + name2







centos






share|improve this question









New contributor




Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 21 at 0:14









Filipe Brandenburger

6,3921726




6,3921726






New contributor




Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 20 at 20:50









Syed Q

61




61




New contributor




Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Syed Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




closed as unclear what you're asking by Christopher, Scott, RalfFriedl, schily, Jesse_b Nov 21 at 16:04


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Christopher, Scott, RalfFriedl, schily, Jesse_b Nov 21 at 16:04


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • What do you wish to happen if service name1 or name2 fails at startup? Should name3 still start the other service, or make sure both services will always be at the same state, i.e. either both running or both stopped, but never just one of the two alone?
    – telcoM
    Nov 20 at 21:59










  • I want both to be running at the same state. If name1 doesn’t start for any reason then name2 shouldn’t either.
    – Syed Q
    Nov 20 at 22:27










  • Is this on CentOS 7? Or an older version? They're different, since CentOS 7 ships systemd...
    – Filipe Brandenburger
    Nov 21 at 0:15










  • You could create a new script that has: service name1 start && service name2 start From man bash: The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.
    – kevlinux
    Nov 21 at 2:29












  • This is on centos 6
    – Syed Q
    Nov 21 at 6:41


















  • What do you wish to happen if service name1 or name2 fails at startup? Should name3 still start the other service, or make sure both services will always be at the same state, i.e. either both running or both stopped, but never just one of the two alone?
    – telcoM
    Nov 20 at 21:59










  • I want both to be running at the same state. If name1 doesn’t start for any reason then name2 shouldn’t either.
    – Syed Q
    Nov 20 at 22:27










  • Is this on CentOS 7? Or an older version? They're different, since CentOS 7 ships systemd...
    – Filipe Brandenburger
    Nov 21 at 0:15










  • You could create a new script that has: service name1 start && service name2 start From man bash: The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.
    – kevlinux
    Nov 21 at 2:29












  • This is on centos 6
    – Syed Q
    Nov 21 at 6:41
















What do you wish to happen if service name1 or name2 fails at startup? Should name3 still start the other service, or make sure both services will always be at the same state, i.e. either both running or both stopped, but never just one of the two alone?
– telcoM
Nov 20 at 21:59




What do you wish to happen if service name1 or name2 fails at startup? Should name3 still start the other service, or make sure both services will always be at the same state, i.e. either both running or both stopped, but never just one of the two alone?
– telcoM
Nov 20 at 21:59












I want both to be running at the same state. If name1 doesn’t start for any reason then name2 shouldn’t either.
– Syed Q
Nov 20 at 22:27




I want both to be running at the same state. If name1 doesn’t start for any reason then name2 shouldn’t either.
– Syed Q
Nov 20 at 22:27












Is this on CentOS 7? Or an older version? They're different, since CentOS 7 ships systemd...
– Filipe Brandenburger
Nov 21 at 0:15




Is this on CentOS 7? Or an older version? They're different, since CentOS 7 ships systemd...
– Filipe Brandenburger
Nov 21 at 0:15












You could create a new script that has: service name1 start && service name2 start From man bash: The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.
– kevlinux
Nov 21 at 2:29






You could create a new script that has: service name1 start && service name2 start From man bash: The control operators && and || denote AND lists and OR lists, respectively. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.
– kevlinux
Nov 21 at 2:29














This is on centos 6
– Syed Q
Nov 21 at 6:41




This is on centos 6
– Syed Q
Nov 21 at 6:41















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

List directoties down one level, excluding some named directories and files

list processes belonging to a network namespace

list systemd RuntimeDirectory mounts