0

I'm trying to create an init script for a web application I want to run on system start up. Looking through the skeleton script provided by my OS (/etc/init.d/skeleton), I saw this:

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin

What does this mean? If I want /usr/bin included in the path, do I have to do something to ensure that mountnfs.sh gets run first?

And where is mountnfs.sh located? I don't see it in my init.d directory.

5
  • what kind of web application? static content? java? ruby? python?
    – dawud
    Jul 23, 2013 at 17:52
  • @dawud I'm using Rails. That's kind of beside the point though, this is something that could be applicable to any init script.
    – Ajedi32
    Jul 23, 2013 at 18:00
  • Not necessarily. You might not need an init script at all. Your web server may have one already. which one will you be using?
    – dawud
    Jul 23, 2013 at 18:04
  • @dawud Currently I'm using thin, but I'd prefer that the init script I'm writing be fairly independent of what web server the deployed app is using.
    – Ajedi32
    Jul 23, 2013 at 18:21
  • Note that an apache+ passenger stack, for example, won't need an init script at all. Anyways, my answer to your init question is below.
    – dawud
    Jul 23, 2013 at 18:23

1 Answer 1

0

You can locate which package contains a file using:

# apt-file search /etc/init.d/mountnfs.sh
initscripts: /etc/init.d/mountnfs.sh

Check if it is installed:

# dpkg -L initscripts | grep /mountnfs.sh
/etc/init.d/mountnfs.sh

The LSB header of that file is informative:

### BEGIN INIT INFO
# Provides:          mountnfs
# Required-Start:    $local_fs
# Required-Stop:
# Should-Start:      $network $portmap nfs-common  udev-mtab
# Default-Start:     S
# Default-Stop:
# Short-Description: Wait for network file systems to be mounted
# Description:       Network file systems are mounted by
#                    /etc/network/if-up.d/mountnfs in the background
#                    when interfaces are brought up; this script waits
#                    for them to be mounted before carrying on.
### END INIT INFO

So if you don't use any NFS mount point, you can safely ignore that comment

1
  • Ah, okay. If that's all it is I'm not sure why that warning is included in the skeleton file, but I guess it doesn't really matter in my case.
    – Ajedi32
    Jul 23, 2013 at 18:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .