• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

rc-service: command not found

by Deepika

OpenRC is an init system and service manager used by some Linux distributions, such as Alpine Linux and Gentoo. It is designed to be lightweight, fast, and simple, while still providing powerful management of system services.

One of the command-line tools provided by OpenRC is rc-service. This tool allows users to locate and manage OpenRC services, including starting, stopping, restarting, and checking the status of services.

rc-service takes two arguments: the first is the name of the service, and the second is the action to be performed on that service. For example, to start the sshd service, you can use the command rc-service sshd start.

It’s worth noting that the rc-service tool is specific to OpenRC and is not available on other init systems, such as systemd or Upstart. If you’re using OpenRC, however, rc-service can be a powerful tool for managing your system services.

If you encounter the below error while running the command rc-service:

rc-service: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install openrc
Alpine apk add openrc
Kali Linux apt-get install openrc
Raspbian apt-get install openrc

rc-service Command Examples

1. Show a service’s status:

# rc-service service_name status

2. Start a service:

# sudo rc-service service_name start

3. Stop a service:

# sudo rc-service service_name stop

4. Restart a service:

# sudo rc-service service_name restart

5. Simulate running a service’s custom command:

# sudo rc-service --dry-run service_name command_name

6. Actually run a service’s custom command:

# sudo rc-service service_name command_name

7. Resolve the location of a service definition on disk:

# sudo rc-service --resolve service_name

Filed Under: Linux

Some more articles you might also be interested in …

  1. getopt: command not found
  2. How to Transfer a File In Passive Mode by FTP
  3. aws-vault Command Examples (A vault for securely storing and accessing AWS credentials in development environments)
  4. What are /dev/zero and /dev/null files in Linux
  5. How to Run DNS and FTP services in a chroot Jail
  6. How to create virtual block device (loop device/filesystem) in Linux
  7. “gitlab-ctl” Command Examples
  8. nohup: command not found
  9. How to Setup SSH keys for “passwordless” ssh login in Linux
  10. CentOS/RHEL 6 Kernel Panic – “Out of memory” kernel parameter panic_on_oom is enabled

You May Also Like

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright