Add the rc script to /usr/local/etc/rc.d/iondtn as root.
The install_dir in the script can be modified to accommodate different installation directories.
The script can be configured in /etc/rc.conf with the following options.
iondtn_enable : enable the service and start it when the machine boots
iondtn_user : user to run the servie as
iondtn_config : location of the configuration file
iondtn_log_dir : directory ion.log is placed in
The status command polls the various ion subcomponents.
The rest of the script should be straight forward.
/usr/local/etc/rc.d/iondtn
Make the above script read only and executable.
The iondtn service uses combined configuration files produced by ionscript.
By default the configuration file in /usr/local/etc/iondtn.rc will be used.
By default, the iondtn service will be run by a user of the same name and
ion.log will be located in /usr/local/iondtn/ion.log.
As root, create the iondtn user and /usr/local/iondtn/ directory.
The iondtn service needs to be able to write to /tmp/ion.sdrlog,
so change the owner of the file or the write permissions.
If multiple users will be using ion, those users need to be able to write to ion.log.
The following command can be used to clear the log without changing the owner or permissions.
Enable the iondtn service in /etc/rc.conf.
Only the iondtn_enable line is required.
Removing this line or changing the value to “NO” will disable
iondtn and it will not start when the machine boots.
The other lines list optional configuration variables and the default values.
These lines can be omitted.
Due to the way memory is shared, running ION-DTN and ION applications as different users may not work reliably.
The solution is to run everything as the iondtn user,
or configure the service to rus as the same user that runs the applications.
For example, an /etc/rc.conf snippet that runs the iondtn service as the bsechter user looks like this.
The iondtn service can now be started from any directory
and ion.log will be in a known location.
Note that due to the su commands in the rc script, the service can only be started or stopped by root.
Any user can use find out if iondtn is running with service iondtn status.