InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Ubuntu tutorials

  • How to add a user on Linux with sudo access
  • How to check if a user has password on Linux
  • How to install ViewVC for svn repository on Ubuntu Linux
  • How to setup ssl (https) for your site on Ubuntu Linux
  • Install rabbitmq on Ubuntu Linux
  • LXC (Linux Containers) - quick start tutorial on Ubuntu
  • Linux - command to check swap size
  • Linux - how to add a user using useradd
  • Linux - how to create a large file like 1GB
  • Linux - how to create swap partition
  • Linux - how to remove user from a group
  • Linux - number of cpus (lscpu)
  • Linux du - find disk usage of directories or files
  • NFS client and server handy commands
  • Setup svn repository on AWS Ubuntu with apache auth
  • Ubuntu - check if a service is upstart based
  • Ubuntu - dpkg and apt-get beginner tutorial
  • Ubuntu - find file to package
  • Ubuntu - find where will a package be installed from
  • Ubuntu - how to auto start services on boot using update-rc.d (sysv init)
  • Ubuntu - how to find boot autostart status of a service
  • Ubuntu - reload iptables rules during boot
  • Use x2go to access remote Ubuntu Linux
 
  • Home
  • > Tutorials
  • > Ubuntu Linux

Ubuntu – how to find boot autostart status of a service

on Feb 13, 2016

There are two types of services on Ubuntu Linux (Ubuntu version 14). One are upstart based and others based on sysv init. To check if a service us upstart based you can visit the tutorial: Ubuntu – check if a service is upstart based.

Check auto start status of sysv init based service

To see if a service will auto start at boot time on Ubuntu we can use on of the following two approaches:

  1. Use update-rc.d to enable service to auto restart with dry-run option -n. If we get “already exist” message, that means service will start on boot.

    ## dry-run
    $ sudo update-rc.d -n nginx defaults
     System start/stop links for /etc/init.d/nginx already exist.
    

    In case we get “Adding system startup” message, that means service will not auto start on boot. It would not make any change since we are running in dry-run mode. He is how it would look:

    ## dry-run
    $ sudo update-rc.d -n nginx defaults
     Adding system startup for /etc/init.d/nginx ...
       /etc/rc0.d/K20nginx -> ../init.d/nginx
       /etc/rc1.d/K20nginx -> ../init.d/nginx
       /etc/rc6.d/K20nginx -> ../init.d/nginx
       /etc/rc2.d/S20nginx -> ../init.d/nginx
       /etc/rc3.d/S20nginx -> ../init.d/nginx
       /etc/rc4.d/S20nginx -> ../init.d/nginx
       /etc/rc5.d/S20nginx -> ../init.d/nginx
    
  2. We can also check /etc/rc*.d/ directories to see if a service will autostart on boot. Presence of symlinks will imply that service will auto start on boot.

    $ ls /etc/rc*.d/*nginx
    /etc/rc0.d/K20nginx  /etc/rc1.d/K20nginx  /etc/rc2.d/S20nginx  /etc/rc3.d/S20nginx  /etc/rc4.d/S20nginx  /etc/rc5.d/S20nginx  /etc/rc6.d/K20nginx
    

Check auto start status of upstart based service

Some services like mysql which are based on upstart has startup job file at /etc/init/mysql.conf. For such scripts, you can view the job config file to find its on boot auto-start status. If you see entry starting with “start on”, it implies that service will auto start on boot at mentioned runlevels. Example entry for mysql:

start on runlevel [2345]

Suggested posts:

  1. How to find docker host ip on Mac
  2. Ubuntu – how to auto start services on boot using update-rc.d (sysv init)
  3. Centos/RHEL – find package for a file
  4. jQuery toggleClass() examples
  5. Chrome extension tutorial – access active page dom
  6. LXC (Linux Containers) – quick start tutorial on Ubuntu
  7. redis cli quick start tutorial
  8. Docker container – handy commands
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Tutorials, Ubuntu Linux
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress