7 Commits

Author SHA1 Message Date
Phil Huang
5c7279e041 Adding init-functions file for enviroment of LSB-compliant init scripts
In Ubuntu 14.04 and 16.04, the file of init-functions is placed in /lib/lsb/.

Change-Id: I101ee08a7b7795c41d9ec3eb8833bee0e2f38e1c
2016-07-07 17:39:20 +00:00
Bob Lantz
7c751b51e7 Cross-platform changes to onos.initd
We now can use start-stop-daemon (debian), daemon()
shell function (centos), or sudo (others) to start
onos-service.

It should be backward compatible on systemd systems.

Tested on Ubuntu 14 and CentOS 6. Should also work on
Ubuntu 15/16, CentOS 7, Debian, and Fedora.

(Note that we should test this against various OSes,
preferably automatically rather than manually!)

Addresses at least part of ONOS-2907

Change-Id: I4ded98baf02321a5a9db37fdff19e1ce4a3d23d2
2016-04-25 15:24:46 +00:00
Jonathan Hart
e01652f745 Add init info to init.d script so it can be configured to run at startup.
Change-Id: Ie8b36ad123febe4be06837f3eb4a2ed28df3b31b
2016-03-29 21:36:34 +00:00
Bob Lantz
641d54540c Fix upstart failing because of background onos-service (ONOS-4117)
1.  Invoke karaf script in all cases (upstart, initd/systemd)

This means that onos-service now blocks, which means we need to
change onos.initd to run it in the background. Otherwise, we could
use karaf/bin/start

This should fix ONOS-4117

2. Use service onos {start/status/etc.} for upstart/init/systemd

onos-install should not invoke the new init.d script directly;
instead it should use service onos {cmd, which should work if
service is available on upstart, init.d, and systemd-based
distributions.

This should fix ONOS-4124

3. In onos.initd, check if ONOS is running.

This makes it easier to see what is going on, and it also avoids
attempting to start ONOS if it's already running.

Change-Id: I0152fd7fdcb079b25531442315d0bd69e6c7653d
2016-03-08 01:32:47 +00:00
Jonathan Hart
1c401ee6b8 Fix issue with debug option not being picked up by init.d script
Change-Id: I47499ae253484d34d677c339b34fec6e53addcbe
2016-03-01 20:03:48 +00:00
Bob Lantz
3ec585d7dd Clarify config parameters/environment variables
As mentioned in the comments, ideally this script can be used as
the basis for an ONOS service in a variety of environments. Out of
the box it should work on Linux with either init.d or with systemd's
init.d compatibility. It can also be called by an upstart configuration
or a systemd configuration.

In the future we should probably remove start-stop-daemon, since that
seems to be a linux-ism. Then we could use this script on BSD, OS X,
etc..

Change-Id: I9c701c95991448fa7ddf0d84d379a4cac56cfc5f
2016-02-29 18:47:58 +00:00
Jonathan Hart
f51950db6e Proposal for replacing Upstart with init.d script.
Change-Id: I22ad1faac713bb50f0b7ad3dde132363a6588723
2016-02-26 05:37:13 +00:00