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?

3
  • This is not a programming related question and should be closed/moved.
    – Anders
    Jul 21, 2010 at 11:15
  • 2
    Why do people vote to move everything vaguely related to Linux to ServerFault? This is clearly a question for SuperUser. Jul 21, 2010 at 11:55
  • This depends on your RC and Linux distribution. Jul 17, 2012 at 17:58

3 Answers 3

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/
3
  • 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, 2010 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, 2010 at 11:58
  • Yep, /sbin/service indeed! Thx
    – sunny8107
    Jul 21, 2010 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.

2
  • 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, 2010 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, 2012 at 11:09
0

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

You must log in to answer this question.