How to start/stop services on Backbox

Started by ghostdog, January 07, 2011, 02:52:55 AM

Previous topic - Next topic

ghostdog

Hi,

First you should be aware of what services you have installed in your system,
by issuing the command :  service --status-all , your system will show you the services available.

exmpl:
   ghostdog@backbox:~$ service --status-all
[ ? ]  acpi-support
[ ? ]  acpid
[ ? ]  alsa-mixer-save
[ ? ]  anacron
[ - ]  apache2
[ - ]  apparmor
[ ? ]  apport
[ ? ]  arpalert
[ ? ]  atd
[ ? ]  atftpd
[ ? ]  avahi-daemon
[ ? ]  binfmt-support
[ - ]  bluetooth
[ - ]  bootlogd
[ - ]  brltty
[ - ]  casper
[ + ]  clamav-freshclam
[ ? ]  console-setup
[ ? ]  cron
[ ? ]  cryptdisks
[ ? ]  cryptdisks-early
[ ? ]  cryptdisks-enable
[ ? ]  cryptdisks-udev
[ ? ]  cups
[ ? ]  dbus
[ - ]  dhcp3-server
[ ? ]  dmesg
[ ? ]  dns-clean
[ ? ]  ecryptfs-utils-restore
[ ? ]  ecryptfs-utils-save
[ ? ]  failsafe-x
[ - ]  fancontrol
[ ? ]  gdm
[ + ]  gpsd
[ - ]  grub-common
[ ? ]  hostname
[ ? ]  hwclock
[ ? ]  hwclock-save
[ ? ]  irqbalance
[ - ]  kerneloops
[ ? ]  killprocs
[ - ]  lm-sensors
[ ? ]  miredo
[ ? ]  miredo-server
[ ? ]  module-init-tools
[ ? ]  mysql
[ ? ]  netdiag
[ ? ]  network-interface
[ ? ]  network-interface-security
[ ? ]  network-manager
[ ? ]  networking
[ ? ]  nstxcd
[ ? ]  nstxd
[ ? ]  ntop
[ ? ]  ondemand
[ + ]  openbsd-inetd
[ - ]  openvas-server
[ ? ]  openvpn
[ ? ]  pcapdump
[ ? ]  pcmciautils
[ ? ]  plymouth
[ ? ]  plymouth-log
[ ? ]  plymouth-splash
[ ? ]  plymouth-stop
[ + ]  postgresql
[ ? ]  pppd-dns
[ - ]  privoxy
[ ? ]  procps
[ + ]  pulseaudio
[ ? ]  rc.local
[ - ]  rsync
[ ? ]  rsyslog
[ + ]  saned
[ ? ]  screen-cleanup
[ - ]  sendmail
[ ? ]  sendsigs
[ - ]  smartmontools
[ ? ]  speech-dispatcher
[ + ]  ssh
[ ? ]  stop-bootlogd
[ ? ]  stop-bootlogd-single
[ ? ]  stunnel4
[ ? ]  sudo
[ ? ]  tcpspy
[ ? ]  tinyproxy
[ - ]  tor
[ ? ]  ubiquity
[ ? ]  udev
[ ? ]  udev-finish
[ ? ]  udevmonitor
[ ? ]  udevtrigger
[ ? ]  ufw
[ ? ]  umountfs
[ ? ]  umountnfs.sh
[ ? ]  umountroot
[ ? ]  unattended-upgrades
[ - ]  urandom
[ ? ]  virtualbox-ose
[ + ]  winbind
[ - ]  x11-common
ghostdog@backbox:~$

* To start or stop a service , type :  sudo /etc/init.d/<service_name> start/stop

Exmpl:
  ghostdog@backbox:~$ sudo /etc/init.d/ssh start
* Starting OpenBSD Secure Shell server sshd                             [ OK ]
ghostdog@backbox:~$


Diavolo_Rosso

Se posso fare una precisazione, il richiamo dei lanciatori tramite /etc/init.d/* sta via via diventando sempre più obsoleto a favore dell'utilizzo di service.

Visto che già lo si usa nell'how-to per vedere lo stato dei servizi, perchè non continuare ad usare service anche per le altre operazioni? ;)

service <service_name> start/stop/status

JoeBlow

THANK YOU SO MUCH for this!
On a similar note, how do I prevent a process from starting up on boot? (and how to restore it later?)
Thanks again!
Best regards -
Joe

b4d_bl0ck

Usually it's as easy as:
sudo update-rc.d <servicename> disable|enable
This is the basic command and most of the times it's all you'll need. It will use the default runlevels to configure the specified init script.
For more details and a more customized configuration, as usual look at the man page: man update-rc.d

Bye.
bool secure = check_paranoia() ? true : false;

Jobs

Exmpl:
1、
alt+F2 open terminal
run the command :  service ssh status/start/stop/restart
2、
run the command : chkconfig ssh on