1

I want my postgres service to start at run levels 2,3,4,5 and stop at 0,1,6.

So, I ran the following command

$ sudo update-rc.d postgresql start 30 2 3 4 5 . stop 30 0 1 6 .

When I stop the instance, and start it back I can see my postgres service is started. However, when I run the following command:

$ls -C /etc/rc*.d|more
/etc/rc0.d:
K10unattended-upgrades  K20screen-cleanup  README           S40umountfs
K15landscape-client     K20td-agent        S20sendsigs      S59cryptdisks-early
K20ds_agent             K20zabbix-agent    S30urandom       S60umountroot
K20rsync                K38open-vm-tools   S31umountnfs.sh  S90halt

/etc/rc1.d:
K00postgresql        K20screen-cleanup  K77ntp        S70pppd-dns
K15landscape-client  K20td-agent        README        S90single
K20ds_agent          K20zabbix-agent    S30killprocs
K20rsync             K38open-vm-tools   S70dns-clean

/etc/rc2.d:
README         S20screen-cleanup  S38open-vm-tools     S99grub-common
S00postgresql  S20td-agent        S45landscape-client  S99ondemand
S20ds_agent    S20zabbix-agent    S70dns-clean         S99rc.local
S20rsync       S23ntp             S70pppd-dns

/etc/rc3.d:
README         S20screen-cleanup  S38open-vm-tools     S99grub-common
S00postgresql  S20td-agent        S45landscape-client  S99ondemand
S20ds_agent    S20zabbix-agent    S70dns-clean         S99rc.local
S20rsync       S23ntp             S70pppd-dns

/etc/rc4.d:
README         S20screen-cleanup  S38open-vm-tools     S99grub-common
S00postgresql  S20td-agent        S45landscape-client  S99ondemand
S20ds_agent    S20zabbix-agent    S70dns-clean         S99rc.local
S20rsync       S23ntp             S70pppd-dns

/etc/rc5.d:
README         S20screen-cleanup  S38open-vm-tools     S99grub-common
S00postgresql  S20td-agent        S45landscape-client  S99ondemand
S20ds_agent    S20zabbix-agent    S70dns-clean         S99rc.local
S20rsync       S23ntp             S70pppd-dns

/etc/rc6.d:
K00postgresql           K20screen-cleanup  S20sendsigs          S60umountroot
K10unattended-upgrades  K20td-agent        S30urandom           S90reboot
K15landscape-client     K20zabbix-agent    S31umountnfs.sh
K20ds_agent             K38open-vm-tools   S40umountfs
K20rsync                README             S59cryptdisks-early

I am not sure why K* entry is not made in /etc/rc0.d. Can someone help me understand?

I am using Ubuntu 14.04.

  • Did you also notice that the Postgres links are created at position 00 instead of 30? Seems like something is wrong with you update-rc.d call, or perhaps the LSB comment header of the init script. You should check man update-rc.d for the details. – Murphy Aug 16 '17 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.