man

NAME
SYNOPSIS
DESCRIPTION
OPTIONS / CONFIGURATION FILE
EXIT STATUS
SIGNALS
FILES
SEE ALSO
BUGS

NAME

x10iod - X10 I/O daemon

SYNOPSIS

x10iod [-i initfile] [-S startscript] [-c command_timeout] [-d device] [-m mapfile] [-g group] [-L logfile] [-r run_format] [-s socketfile] [-t timeout] [-T devicetype] [-u user] [-z debuglevel]

DESCRIPTION

x10iod is an X10 daemon which accepts commands via UNIX domain sockets and forwards them onto an X10 interface via a serial link. It can also receive and respond to commands from the power line if the X10 interface supports it. The program sets its user ID to an X10 user on startup, changes to that user’s home directory, and sets the environment variables HOME and USER appropriately. It then forks off as is traditional with daemons.

When x10iod responds to an X10 command on the powerline, it invokes an external program (such as a shell script) to respond to the event, passing the house code, unit code, and command. The external program must handle the event within the alloted time, or it is killed. If additional events are received while one event is being processed, they are queued and executed sequentially as prior ones complete (or are killed).

OPTIONS / CONFIGURATION FILE

-i initfile

Read configuration data from the specified file. Settings in the file override previous command-line options, but following command-line options override the file. There is no configuration-file equivalent to this option.

-s startscript / InitScript

Startup script that is run once shared memory is initialized. The script can use x10cli(1) to set device parameters, such as device vs. appliance status or if that device should invoke a script. Default: do not run a start script.

-c command_timeout / CommandTimeout

Specifies the time in which external programs must complete. Default: 15 seconds.

-d device / Port

Specifies the serial device, such as /dev/ttyS1, to which the X10 interface is connected. Default: /dev/ttyS1.

-g group / Group

The group to which ownership of the UNIX domain socket should be assigned. May be group name or ID. Default: x10.

-L logfile / LogFile

File to which activity should be logged. Default: x10iod.log.

-m mapfile / MapFile

The name of a map file which x10iod uses to keep track of the status of all X10 devices. Default: /tmp/x10map.

-r run_format / RunMe

The format of commands to run when events are received from the power line. This is a printf-style string with two parameters: house code and unit code. The default is /usr/local/bin/x10/%c%02d. However, the configuration supplied with the package sets this to ~x10/x10event, and the script uses the parameters passed to it (house code, unit code, and event type) to determine what action to take.

-s socketfile / SocketFile

The name of the UNIX domain socket from which x10iod receives commands. Default: /tmp/x10.

-T devicetype / DeviceType

Specifies the type of X10 interface. Options are: twoway, cp290. Default: twoway.

-t timeout / Timeout

Specifies the retry interval for X10 commands, in seconds. The X10 interface is expected to provide a confirmation within this time. Default: 10 seconds.

-u user / User

The user to which the daemon setpid(1)s during startup. Default: x10.

-z debuglevel

Change the logging level. Available levels are 0-3. Level 0 contains only errors, 1 adds warnings, 2 adds informational messages, and 3 adds trace messages. Default: Informational, warning, and error messages.

EXIT STATUS

0

Daemon successfully started.

>0

Daemon failed startup.

SIGNALS

HUP

The HUP signal causes the daemon to close and re-open the log file the next time an event is logged.

FILES

/tmp/x10

UNIX domain socket used to send commands to x10iod.

/tmp/x10map

A binary file containing status of X10 devices.

/usr/local/bin/x10

Default directory containing event-handler scripts. Scripts are named Xnn, where X is the house code and nn is the unit code.

~x10/x10event

Script which handles events when using the supplied configuration.

SEE ALSO

x10cli(1), x10event(1), printf(3).

BUGS

SIGHUP signal causes the daemon to crash occasionally. I haven’t determined why.