LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2005, 08:14 PM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,269

Rep: Reputation: 52
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.
 
Old 05-06-2005, 08:29 PM   #2
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
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.
 
Old 05-06-2005, 08:51 PM   #3
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,269

Original Poster
Rep: Reputation: 52
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.
 
Old 05-06-2005, 11:08 PM   #4
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Rep: Reputation: 46
Link the /etc/init.d/ scripts you wish into /bin. At least here its enough.
 
Old 05-07-2005, 12:38 AM   #5
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,269

Original Poster
Rep: Reputation: 52
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)
 
Old 06-06-2005, 11:39 AM   #6
nvm
LQ Newbie
 
Registered: Jun 2005
Location: Glasgow, Scotland
Distribution: Debian
Posts: 12

Rep: Reputation: 0
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.
 
Old 06-06-2005, 05:47 PM   #7
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,269

Original Poster
Rep: Reputation: 52
Sweet! Thanks, I named it ser so it's even faster then it was in redhat.
 
Old 03-09-2009, 06:05 AM   #8
mccwho
LQ Newbie
 
Registered: May 2008
Location: Columbus
Distribution: RH, CentOS, Debian, Ubuntu, Mandrevia
Posts: 7

Rep: Reputation: 0
just use alias.

You could just use the alias command to set an alias.
 
Old 03-09-2009, 03:21 PM   #9
sureshsujatha
Member
 
Registered: Mar 2009
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by nvm View Post
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 !!!

Last edited by sureshsujatha; 03-14-2009 at 01:21 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
stopping services not in xinetd.d branden_burger Linux - Security 2 04-12-2005 09:34 PM
starting & stopping services/daemons rand0mh3ro Linux - General 4 02-16-2005 09:27 AM
stopping services? piglingz Linux - Software 3 06-24-2003 05:26 PM
Starting / Stopping / Restarting Services in VA Linux? abell Linux - General 1 11-15-2002 02:17 PM
stopping and starting services nero64 Linux - Newbie 3 11-13-2002 02:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration