LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   starting/stopping services in debian (https://www.linuxquestions.org/questions/linux-software-2/starting-stopping-services-in-debian-320881/)

Red Squirrel 05-06-2005 07:14 PM

starting/stopping services in debian
 
Is there a package I can get that would enable me to type

service [servicename] [command]

to initiate the service script in /etc/init.d with it's command? I'm so used to redhad and now that I'm in debian I find it long to have to type /etc/init.d/servicename command. Really this could probably be done with a bash script put into the bin folder, but my bash scripting knowledge is not advanced enough yet to do this myself. Any suggestions would be apreciated. Thanks.

Lleb_KCir 05-06-2005 07:29 PM

tab is your friend. once you type /et you can hit the tab key, then type in, again hit tab, and last type in the first bit of the service and hit tab to finish the service. space then start, stop, restart and you are done.

as for getting things to run like in RH with the service name command i have no clue. i had that same issue when i first moved to debain off of RH9, but even in RH9 you could always use the /etc/init.d/service command to work with things so now i do not worry about it.

Red Squirrel 05-06-2005 07:51 PM

Yeah tab does help but typing service name is still faster. :P But not really a big issue. Either there's a script or something I can get/make or I'll just get used to it.

bruno buys 05-06-2005 10:08 PM

Link the /etc/init.d/ scripts you wish into /bin. At least here its enough.

Red Squirrel 05-06-2005 11:38 PM

Hmm yeah that could work. So all I type is apache start or apache stop. I'd rename it to something like srv_apache to avoid conflicts with existing commands. (ex: spamd)

nvm 06-06-2005 10:39 AM

Create a file named service containing the following:

Code:

/etc/init.d/$1 $2
Make it executable with chmod +x service, copy it to your path (/usr/bin or equivalent) and it should work as you expect.

Red Squirrel 06-06-2005 04:47 PM

Sweet! Thanks, I named it ser so it's even faster then it was in redhat. :D

mccwho 03-09-2009 05:05 AM

just use alias.
 
You could just use the alias command to set an alias.

sureshsujatha 03-09-2009 02:21 PM

Quote:

Originally Posted by nvm (Post 1680412)
Create a file named service containing the following:

Code:

/etc/init.d/$1 $2
Make it executable with chmod +x service, copy it to your path (/usr/bin or equivalent) and it should work as you expect.


Wow ... Thats something new I learnt today ... Cooooool !!!
:)


All times are GMT -5. The time now is 09:59 AM.