1101 and 1102 Secure Device Servers
portmanager daemon
There is normally no need to stop and restart the daemon. To restart the daemon normally, just run the command:
# portmanager |
|
Supported command line options are: |
|
Force portmanager to run in the foreground: | |
Set the level of debug logging: | |
Change which configuration file it uses: |
Signals
Sending a SIGHUP signal to the portmanager will cause it to
The portmanager can execute external scripts on certain events.
When the portmanager opens a port:
It attempts to execute /etc/config/scripts/portXX.init (where XX is the number of the port, e.g. 08). The script is run with STDIN and STDOUT both connected to the serial port.
If the script cannot be executed, then portmanager will execute /etc/config/scripts/portXX.chat via the chat command on the serial port.
When an alert occurs on a port:
The portmanager will attempt to execute /etc/config/scripts/portXX.alert (where XX is the port number, for example, 08)
The script is run with STDIN containing the data which triggered the alert, and STDOUT redirected to /dev/null, NOT to the serial port. If you want to communicate with the port, use pmshell or pmchat from within the script.
If the script cannot be executed, then the alert will be mailed to the address configured in the system administration section.
When a user connects to any port:
If a file
</etc/config/pmshell-start.sh > #!/bin/sh
PORT="$1"
USER="$2"
echo "Welcome to port $PORT $USER"
The return value from the script controls whether the user is accepted or not, if 0 is returned (or nothing is done on exit as in the above script) the user is permitted, otherwise the user is denied access.
Here is a more complex script which reads from configuration to display the port label if available and denies access to the root user:
PORT="$1"
USER="$2"
LABEL=$(config
echo "Permission denied for Super User" exit 1
fi
if [
echo "Welcome $USER, you are connected to Port $PORT" else
echo "Welcome $USER, you are connected to Port $PORT ($LABEL)"
144 |