How to enable/disable/start/stop a service in Fedora 16
If you are looking for managing system services in earlier versions of Fedora, read this article.
For all those who are using earlier versions of Fedora, the standard chkconfig commands appears to be doing nothing. All the services in Fedora are controlled using a new command called “systemctl“.
The “systemctl” command, if run without any arguments, prints all the system services (units) as shown below.
[neo@techpulp ~]# systemctl UNIT LOAD ACTIVE SUB JOB DESCRIPTION proc-sys...misc.automount loaded active running Arbitrary Executable File Formats File System Automount Point ... sys-devi...y-tty10.device loaded active plugged /sys/devices/virtual/tty/tty10 sys-devi...y-tty11.device loaded active plugged /sys/devices/virtual/tty/tty11 ... abrt-ccpp.service loaded active exited Install ABRT coredump hook abrt-oops.service loaded active running ABRT kernel log watcher abrt-vmcore.service loaded active exited Harvest vmcores for ABRT abrtd.service loaded active running ABRT Automated Bug Reporting Tool accounts-daemon.service loaded active running Accounts Service auditd.service loaded active running Security Auditing Service avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack console-...daemon.service loaded active running Console Manager console-...-start.service loaded active exited Console System Startup Logging dbus.service loaded active running D-Bus System Message Bus fedora-l...odules.service loaded active exited Load legacy module configuration fedora-readonly.service loaded active exited Configure read-only root support fedora-s...t-late.service loaded active exited Initialize storage subsystems (RAID, LVM, etc.) fedora-s...e-init.service loaded active exited Initialize storage subsystems (RAID, LVM, etc.) fedora-w...torage.service loaded active exited Wait for storage scan ... udev-kernel.socket loaded active running udev Kernel Socket dev-sda7.swap loaded active active /dev/sda7 basic.target loaded active active Basic System cryptsetup.target loaded active active Encrypted Volumes getty.target loaded active active Login Prompts graphical.target loaded active active Graphical Interface local-fs-pre.target loaded active active Local File Systems (Pre) local-fs.target loaded active active Local File Systems multi-user.target loaded active active Multi-User network.target loaded active active Network remote-fs.target loaded active active Remote File Systems sockets.target loaded active active Sockets sound.target loaded active active Sound Card swap.target loaded active active Swap sysinit.target loaded active active System Initialization syslog.target loaded active active Syslog systemd-...ead-done.timer loaded active elapsed Stop Read-Ahead Data Collection 10s After Completed Startup systemd-...es-clean.timer loaded active waiting Daily Cleanup of Temporary Directories LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB = The low-level unit activation state, values depend on unit type. JOB = Pending job for the unit. 109 units listed. Pass --all to see inactive units, too.
Typically all system services will have .service as suffix in the unit name.
To disable a service,
[root@techpulp ~]# systemctl disable sendmail.service rm '/etc/systemd/system/multi-user.target.wants/sendmail.service' [root@techpulp ~]#
To enable a service,
[root@techpulp ~]# systemctl enable sendmail.service ln -s '/lib/systemd/system/sendmail.service' '/etc/systemd/system/multi-user.target.wants/sendmail.service' [root@techpulp ~]#
To start a service,
[root@techpulp ~]# systemctl start sshd.service
To stop a service
[root@techpulp ~]# systemctl stop sshd.service
To check the status of a service,
[root@techpulp ~]# systemctl status sshd.service sshd.service - OpenSSH server daemon Loaded: loaded (/lib/systemd/system/sshd.service; enabled) Active: active (running) since Wed, 28 Dec 2011 17:46:39 +0530; 1min 0s ago Main PID: 1650 (sshd) CGroup: name=systemd:/system/sshd.service └ 1650 /usr/sbin/sshd -D [root@techpulp ~]#


about 1 year ago
I have to say, while looking tgruohh hundreds of blogs daily, the theme of this blog is different (for all the proper reasons). If you do not mind me asking, what’s the name of this theme or would it be a especially designed affair? It’s significantly better compared to the themes I use for some of my blogs.