[arch-general] manage starting and stopping processes with less typing

Gaurish Sharma contact at gaurishsharma.com
Tue Apr 13 15:34:56 EDT 2010


On Wednesday 14 Apr 2010 12:52:43 am David C. Rankin wrote:
> Guys,
> 
> 	One thing I miss with Arch are init-script shortcuts for starting and
> stopping processes. rc-commands really help cut down on typing. For
> example, all suse did was to create links to the files in /etc/rc.d/...
> with a naming convention of rc<init script name>. So, for example, instead
> of having to type:


I wrote a similar bash function, which I placed my ~/.bashrc. Sharing it here:

start()
{
  for arg in $*; do
    sudo /etc/rc.d/$arg start
  done
} 
restart()
{
  for arg in $*; do
    sudo /etc/rc.d/$arg restart
  done
} 
stop()
{
  for arg in $*; do
    sudo /etc/rc.d/$arg stop
  done
}
status()
{
        for arg in $*; do
                sudo /etc/rc.d/$arg status
        done
}
log()
{
        for arg in $*; do
                sudo less /var/log/$arg
        done
}

It works as
$ start <insert service name>
$ restart <insert service name>
$ status <insert service name>

Hope it helps
-- 
Regards,
Gaurish Sharma
www.gaurishsharma.com


More information about the arch-general mailing list