• 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-update Command Examples in Linux

by Deepika

In OpenRC, runlevels are used to define the state of the system and the services that should be running at any given time. rc-update is a command-line tool that allows you to manage the services that are started or stopped at different runlevels.

rc-update provides several subcommands that can be used to add or remove services from runlevels. The add subcommand is used to add a service to a runlevel, while the del subcommand is used to remove a service from a runlevel. For example, to add the sshd service to the default runlevel, you can use the command rc-update add sshd default.

By default, rc-update will modify the system configuration files to reflect the changes you’ve made. However, you can use the –no-save option to make temporary changes that will be lost when the system is rebooted.

rc-update also provides several options that can be used to specify the runlevel, service status, or other parameters. For example, you can use the –quiet option to suppress output, or the –debug option to enable debugging output.

rc-update Command Examples

1. List all services and the runlevels they are added to:

# rc-update show

2. Add a service to a runlevel:

# sudo rc-update add service_name runlevel

3. Delete a service from a runlevel:

# sudo rc-update delete service_name runlevel

4. Delete a service from all runlevels:

# sudo rc-update --all delete service_name

Summary

In addition to managing services in runlevels, rc-update can also be used to manage the dependencies between services. The depend subcommand is used to modify the dependencies between services, while the show subcommand can be used to display the dependencies between services.

Overall, rc-update is a powerful tool for managing OpenRC services and runlevels, and it can help you customize the behavior of your system to meet your specific needs.

Filed Under: Linux

Some more articles you might also be interested in …

  1. git rebase Command Examples
  2. pam_tally2 command – lock & unlock ssh failed logins in linux
  3. doctl kubernetes options: Provides values available for use with doctl’s Kubernetes commands
  4. git commit-graph: Write and verify Git commit-graph files
  5. bc: command not found
  6. sar Command Examples in Linux
  7. atool: command not found
  8. pw-record Command Examples in Linux
  9. env Command Examples in Linux
  10. What is Anacron and usage of Anacron in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright