6

I check the status of the vncserver program and found it to be available in both:

/etc/init.d/vncserver and /etc/rc.d/init.d/vncserver

Both works, but which one is the "real" one?

  • This is not a programming related question and should be closed/moved. – Anders Jul 21 '10 at 11:15
  • 2
    Why do people vote to move everything vaguely related to Linux to ServerFault? This is clearly a question for SuperUser. – Tyler McHenry Jul 21 '10 at 11:55
  • This depends on your RC and Linux distribution. – Tamara Wijsman Jul 17 '12 at 17:58
7

The "real" one is /etc/init.d/<<script>> since rc.d is for the system startup.

You can also use service vncserver start

Edit: in some linux distribs, rc.d doesn't exist as it in /etc

$ ls /etc/rc
rc0.d/    rc1.d/    rc2.d/    rc3.d/    rc4.d/    rc5.d/    rc6.d/    rc.local  rcS.d/
  • Interesting, but looks like I don't have the service program on the linux machine :-( $service vncserver status bash: service: command not found – sunny8107 Jul 21 '10 at 11:45
  • 1
    It's usually in /sbin, which will be in your path if you log in as root. If you just su / sudo you'll need to do /sbin/service vncserver. Or your distro might not provide one - it's definitely there in RHEL/Fedora/CentOS – Rup Jul 21 '10 at 11:58
  • Yep, /sbin/service indeed! Thx – sunny8107 Jul 21 '10 at 12:29
6

In Red Hat based distributions, /etc/init.d is a symbolic link to /etc/rc.d/init.d, so both listings actually refer to the same exact file.

  • You are right! ls -l /etc/init.d lrwxrwxrwx 1 root root 11 Aug 22 2007 /etc/init.d -> rc.d/init.d – sunny8107 Jul 21 '10 at 11:44
  • @deesto Thanks - you're right, most of my experience is with Red Hat / Fedora / CentOS, but I had thought that was common beyond Red Hat. I realise Ubuntu is widely used nowadays and they like to do everything different though! – Rup Apr 25 '12 at 11:09
0

Realone is a /etc/rc.d/init.d/vncserver

Your Answer

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