contrib: remove obsolete upstart files

Move the remaining launchd and systemd files to top-level directories

Change-Id: Ic459b9b7302a7fc574b4e93f1c9d1fe05350761c
diff --git a/contrib/upstart/README.md b/contrib/upstart/README.md
deleted file mode 100644
index ff0042e..0000000
--- a/contrib/upstart/README.md
+++ /dev/null
@@ -1,125 +0,0 @@
-Starting NFD on Linux with upstart
-==================================
-
-Some Linux distributions, such as Ubuntu, use [upstart](http://upstart.ubuntu.com/) as a
-standard mechanism to start system daemons, monitor their health, and restart
-when they die.
-
-Initial setup
--------------
-
-* Edit `nfd.conf` correcting paths for `nfd` binary, configuration and log files.
-
-* Copy upstart config file for NFD
-
-        sudo cp nfd.conf /etc/init/
-
-### Assumptions in the default scripts
-
-* `nfd` is installed into `/usr/local/bin`
-* Configuration file is `/usr/local/etc/ndn/nfd.conf`
-* `nfd` will be run as root
-* Log files will be written to `/usr/local/var/log/ndn` folder, which is owned by user `ndn`
-
-### Creating users
-
-If `ndn` user and group does not exists, they need to be manually created.
-
-    # Create group `ndn`
-    addgroup --system ndn
-
-    # Create user `ndn`
-    sudo adduser --system \
-                 --disabled-login \
-                 --ingroup ndn \
-                 --home /nonexistent \
-                 --gecos "NDN User" \
-                 --shell /bin/false \
-                 ndn
-
-
-### Creating folders
-
-Folder `/usr/local/var/log/ndn` should be created and assigned proper user and group:
-
-    sudo mkdir -p /usr/local/var/log/ndn
-    sudo chown -R ndn:ndn /usr/local/var/log/ndn
-
-`HOME` directory for `nfd` should be created prior to starting.  This is necessary to manage
-unique security credentials for the deamon.
-
-    # Create HOME and generate self-signed NDN certificate for nfd
-    sudo -s -- ' \
-      mkdir -p /usr/local/var/lib/ndn/nfd/.ndn; \
-      export HOME=/usr/local/var/lib/ndn/nfd; \
-      ndnsec-keygen /localhost/daemons/nfd | ndnsec-install-cert -; \
-    '
-
-### Configuring NFD's security
-
-NFD sample configuration allows anybody to create faces, add nexthops to FIB, and set
-strategy choice for namespaces.  While such settings could be a good start, it is
-generally not a good idea to run NFD in this mode.
-
-While thorough discussion about security configuration of NFD is outside the scope of this
-document, at least the following change should be done to ``nfd.conf`` in authorize
-section:
-
-    authorizations
-    {
-      authorize
-      {
-        certfile certs/localhost_daemons_nfd.ndncert
-        privileges
-        {
-            faces
-            fib
-            strategy-choice
-        }
-      }
-
-      authorize
-      {
-        certfile any
-        privileges
-        {
-            faces
-            strategy-choice
-        }
-      }
-    }
-
-While this configuration still allows management of faces and updating strategy choice by
-anybody, only NFD's RIB Manager (i.e., NFD itself) is allowed to manage FIB.
-
-As the final step to make this configuration work, nfd's self-signed certificate needs to
-be exported into `localhost_daemons_nfd.ndncert` file:
-
-    sudo -s -- '\
-      mkdir -p /usr/local/etc/ndn/certs || true; \
-      export HOME=/usr/local/var/lib/ndn/nfd; \
-      ndnsec-dump-certificate -i /localhost/daemons/nfd > \
-        /usr/local/etc/ndn/certs/localhost_daemons_nfd.ndncert; \
-      '
-
-
-Enable auto-start
------------------
-
-After copying the provided upstart script, `nfd` daemon will automatically run after the reboot.
-To manually start them, use the following commands:
-
-    sudo start nfd
-
-Disable auto-start
-------------------
-
-To stop `nfd` daemon, use the following commands:
-
-    sudo stop nfd
-
-Note that as long as upstart files are present in `/etc/init/`, the daemon will
-automatically start after the reboot.  To permanently stop `nfd` daemon, delete
-the upstart files:
-
-    sudo rm /etc/init/nfd.conf
diff --git a/contrib/upstart/nfd.conf b/contrib/upstart/nfd.conf
deleted file mode 100644
index d3673f5..0000000
--- a/contrib/upstart/nfd.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-# nfd.conf
-#
-# NDN Forwarding Daemon
-
-description "NDN forwarding daemon"
-
-start on (local-filesystems and net-device-up IFACE!=lo)
-stop on runlevel [!2345]
-
-respawn
-respawn limit unlimited
-
-env HOME=/usr/local/var/lib/ndn/nfd
-export HOME
-
-exec /usr/local/bin/nfd --config /usr/local/etc/ndn/nfd.conf 2>> /usr/local/var/log/ndn/nfd.log
-
-post-start script
-  if [ -f /usr/local/etc/ndn/nfd-init.sh ]; then
-      sleep 2 # post-start is executed just after nfd process starts, but there is no guarantee
-              # that all initialization has been finished
-      . /usr/local/etc/ndn/nfd-init.sh
-  fi
-end script
-
-post-stop exec sleep 2
diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index ff2ad51..0fad1fb 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -7,11 +7,11 @@
 We provide NFD binaries for the supported platforms, which are the preferred installation
 method. In addition to simplifying installation, the binary release also includes automatic
 initial configuration and platform-specific tools to automatically start NFD and related
-daemons.  In particular, on macOS the binary release of NFD comes as part of `NDN Control
+daemons.  In particular, on macOS the binary release of NFD comes as part of the `NDN Control
 Center <https://named-data.net/codebase/applications/ndn-control-center/>`__ and provides a
-convenient way to configure and launch NFD daemon.  :ref:`PPA packages for Ubuntu <Install NFD
-Using the NDN PPA Repository on Ubuntu Linux>` include ``upstart`` and ``systemd``
-configuration to automatically start daemon after boot.
+convenient way to configure and launch the NFD daemon. :ref:`PPA packages for Ubuntu <Install
+NFD Using the NDN PPA Repository on Ubuntu Linux>` include ``systemd`` service files to
+automatically start the daemon after boot.
 
 Besides officially supported platforms, NFD is known to work on: Fedora 20+, CentOS 6+, Gentoo
 Linux, Raspberry Pi, OpenWRT, FreeBSD 10+, and several `other platforms
@@ -252,12 +252,12 @@
     nfd-start
 
 On macOS it may ask for your keychain password or ask ``nfd wants to sign using key in
-your keychain.`` Enter your keychain password and click Always Allow.
+your keychain``. Enter your keychain password and click "Always Allow".
 
 Later, you can stop NFD with ``nfd-stop`` or by simply killing the ``nfd`` process.
 
-If you have installed NFD using a package manager, you can start and stop NFD service using the
-operating system's service manager (such as Upstart, systemd, or launchd) or using
+If you have installed NFD using a package manager, you can start and stop NFD using the
+operating system's service manager (such as systemd or launchd) or using
 "Automatically start NFD" option in NDN Control Center app.
 
 Connecting to remote NFDs
diff --git a/contrib/osx-launchd/README.md b/launchd/README.md
similarity index 100%
rename from contrib/osx-launchd/README.md
rename to launchd/README.md
diff --git a/contrib/osx-launchd/net.named-data.nfd.plist b/launchd/net.named-data.nfd.plist
similarity index 100%
rename from contrib/osx-launchd/net.named-data.nfd.plist
rename to launchd/net.named-data.nfd.plist
diff --git a/contrib/systemd/README.md b/systemd/README.md
similarity index 94%
rename from contrib/systemd/README.md
rename to systemd/README.md
index d129b5e..45d24e3 100644
--- a/contrib/systemd/README.md
+++ b/systemd/README.md
@@ -109,7 +109,7 @@
 Enable auto-start
 -----------------
 
-After copying the provided upstart script, auto-start of the `nfd` daemon can be enabled with:
+After copying the provided `nfd.service` file, auto-start can be enabled with:
 
     sudo systemctl enable nfd
 
@@ -124,7 +124,7 @@
 
     sudo systemctl stop nfd
 
-To permanently stop the `nfd` daemon and disable it from being automatically started on reboot,
+To prevent it from being automatically started on reboot,
 disable the service:
 
     sudo systemctl disable nfd
diff --git a/contrib/systemd/nfd.service b/systemd/nfd.service
similarity index 100%
rename from contrib/systemd/nfd.service
rename to systemd/nfd.service