| 1 |
/* |
| 2 |
* Argus Clients Software |
| 3 |
* Copyright (c) 2000-2024 QoSient, LLC |
| 4 |
* All rights reserved. |
| 5 |
* |
| 6 |
* Permission to use, copy, modify, and distribute this software and |
| 7 |
* its documentation for any purpose and without fee is hereby granted, |
| 8 |
* provided that the above copyright notice appear in all copies and |
| 9 |
* that both that copyright notice and this permission notice appear |
| 10 |
* in supporting documentation, and that the name of QoSient not be |
| 11 |
* used in advertising or publicity pertaining to distribution of the |
| 12 |
* software without specific, written prior permission. |
| 13 |
* |
| 14 |
* QOSIENT, LLC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS |
| 15 |
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 16 |
* FITNESS, IN NO EVENT SHALL QOSIENT, LLC BE LIABLE FOR ANY |
| 17 |
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER |
| 18 |
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF |
| 19 |
* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
| 20 |
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 21 |
* |
| 22 |
*/ |
| 23 |
|
| 24 |
These scripts are intended to help manage the starting/stopping of |
| 25 |
argus client daemons, such as radium and rasplit, both during system boot |
| 26 |
as well as in normal operation. The strategies currently supported are Linux's |
| 27 |
chkconfig system, systemctl and Apple Mac OS X's launchctl, using |
| 28 |
/Library/StartupItems packages. |
| 29 |
|
| 30 |
With all of these examples, care needs to be taken to ensure that |
| 31 |
system configuration files, such as /etc/radium.conf, or /etc/rarc, |
| 32 |
are "in sync" with the intent of these daemons, and that the command |
| 33 |
line options set the appropriate mode of opertion. |
| 34 |
|
| 35 |
Generally, most system /etc configurations should set the program to |
| 36 |
NOT run as a daemon, and the startup scripts should use the "-d" option. |
| 37 |
However, this is simply a suggestion. |
| 38 |
|
| 39 |
|
| 40 |
Under Linux |
| 41 |
|
| 42 |
The ./radium script takes one of four arguments, start, stop, restart |
| 43 |
and status. If the specific /etc configuration file is not found, |
| 44 |
the daemon will be run with some assumptions about the system configuration |
| 45 |
and writes its logs to /var/log/radium. |
| 46 |
|
| 47 |
For installation on Linux: |
| 48 |
|
| 49 |
The linux chkconfig system, assumes that the scripts that are run from |
| 50 |
the /etc/init.d directory return, as the boot process runs each script |
| 51 |
sequentially, and doesn't progress until each process returns. |
| 52 |
|
| 53 |
This means that radium need to run as daemons, in the background. |
| 54 |
As a result, do check that the /etc/radium.conf configuration file, |
| 55 |
set the [ARGUS|RADIUM}_DAEMON variable to "yes". |
| 56 |
|
| 57 |
Edit the PATH variable in the script to the directory the binary is |
| 58 |
located in. |
| 59 |
|
| 60 |
Then, install the script in /etc/rc.d/init.d. After this, if your system |
| 61 |
supports the chkconfig() utility, you can use that to install radium and |
| 62 |
then have it start when the system boots. |
| 63 |
|
| 64 |
|
| 65 |
# cp radium /etc/rc.d/init.d |
| 66 |
# chkconfig --add radium |
| 67 |
# chkconfig --level 2345 radium on |
| 68 |
|
| 69 |
|
| 70 |
If your system doesn't have chkconfig(), then simply create a link to the |
| 71 |
/etc/rc.d/init.d/radium file in the run level that you want the daemon to |
| 72 |
run in. Most systems will have this as run level 3. |
| 73 |
|
| 74 |
# cd /etc/rc.d/rc3.d |
| 75 |
# ln -s ../init.d/radium radium |
| 76 |
|
| 77 |
|
| 78 |
Systemctl |
| 79 |
|
| 80 |
The radium.service file can be used on Fedora (and RedHat Linux?) to automatically |
| 81 |
start radium at boot time. Put the file radium.service in /lib/systemd/system, then |
| 82 |
run these two commands as root: |
| 83 |
|
| 84 |
# systemctl enable radium.service |
| 85 |
# systemctl start radium.service |
| 86 |
|
| 87 |
After that, radium should be automatically started when the system boots. |
| 88 |
|
| 89 |
|
| 90 |
Mac OS X |
| 91 |
|
| 92 |
Launchctl |
| 93 |
|
| 94 |
The com.qosient.radium.plist and com.qosient.rasplit.plist configuration files |
| 95 |
are used with the Mac OS X launchctl system. These files should be installed |
| 96 |
into the /Library/LaunchDaemons directory on the target machine. This will |
| 97 |
allow Mac OS X to radium and rasplit when the machine boots, and to ensure |
| 98 |
that they are always running. |
| 99 |
|
| 100 |
The included scripts assume that radium and rasplit have been installed in the |
| 101 |
default /usr/local/bin directory, so if you have done something out of the ordinary, |
| 102 |
you will need to modify the scripts. |
| 103 |
|
| 104 |
For installation on Mac OS X: |
| 105 |
# cp com.qosient.radium.plist /Library/LaunchDaemons |
| 106 |
# cp com.qosient.rasplit.plist /Library/LaunchDaemons |
| 107 |
# launchctl load /Library/LaunchDaemons/com.qosient.radium.plist |
| 108 |
# launchctl load /Library/LaunchDaemons/com.qosient.rasplit.plist |