<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is Copyright 2010 by the GPSD project
SPDX-License-Identifier: BSD-2-clause
-->
<!DOCTYPE refentry PUBLIC
   "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id='gpsdctl.8'>
<refentryinfo><date>11 June 2020</date></refentryinfo>
<refmeta>
<refentrytitle>gpsdctl</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo class="source">The GPSD Project</refmiscinfo>
<refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>gpsdctl</refname>
<refpurpose>tool for sending commands to gpsd over its control socket</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>

<cmdsynopsis>
  <command>gpdsctl</command>
        <arg choice='plain'><replaceable>action</replaceable></arg>
        <arg choice='plain'><replaceable>device</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsect1 id='description'><title>DESCRIPTION</title>

<para>This is a tool for sending an instance of
<application>gpsd</application> commands over its control socket to
add or remove devices from the daemon's device list. It is not
intended to be called by users, but rather by the Linux hotplug
system and similar facilities.</para>

<para>The action argument may be "add" or "remove". If no daemon
instance is running when an add is requested, this program will launch
one.</para>

<para>The "device" argument should be the pathname of a device. A
device on the list will be opened to read sensor data whenever a
client requests a watch.</para>

<para>Two environment variables are interpreted.</para>

<para><envar>GPSD_SOCKET</envar> sets the location
of the control socket.  If the effective user ID of
this program is root then it usually defaults to
<filename>/run/gpsd.sock</filename>, although some systems may use the
deprecated <filename>/var/run/gpsd.sock</filename> instead.  Non-root
users will use <filename>/tmp/gpsd.sock</filename>.</para>

<para><envar>GPSD_OPTIONS</envar>
may be a list of options to be passed to <application>gpsd</application>
when this tool launches it.  It defaults to an empty string.</para>
</refsect1>

<refsect1 id='exit_status'><title>RETURN VALUES</title>

<para>1 if the action was unknown or the write to the control socket
failed, 0 otherwise</para>

</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgpsmm</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsprof</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsfake</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
</refsect1>

<refsect1 id='maintainer'><title>AUTHOR</title>

<para>Eric S. Raymond <email>esr@thyrsus.com</email>.</para>
</refsect1>
</refentry>
