1GAMMU-SMSD(1)                        Gammu                       GAMMU-SMSD(1)
2
3
4

NAME

6       gammu-smsd - SMS daemon for Gammu
7

SYNOPSIS

9          gammu-smsd [OPTION]...
10

DESCRIPTION

12       This manual page documents briefly the gammu-smsd command.
13
14       gammu-smsd  is a program that periodically scans GSM modem for received
15       messages, stores them  in  defined  storage  and  also  sends  messages
16       enqueued in this storage.
17
18       The  daemon  can  reload configuration file after sending hangup signal
19       (SIGHUP) and properly terminates itself on SIGINT and SIGTERM.
20
21       Program accepts following options (please note that long options  might
22       be not accepted on some platforms):
23
24       -h, --help
25              Shows help.
26
27       -v, --version
28              Shows version information and compiled in features.
29
30       -c, --config=file
31              Configuration file to use, default is /etc/gammu-smsdrc, on Win‐
32              dows there is no default and configuration file path has  to  be
33              always specified.
34
35              If  you  run  SMSD as a system daemon (or service), it is recom‐
36              mended to use absolute path to  configuration  file  as  startup
37              directory might be different than you expect.
38
39              See gammu-smsdrc for configuration file documentation.
40
41       -p, --pid=file
42              Lock  file  for storing pid, empty for no locking. Not supported
43              on Windows.
44
45       -U, --user=user
46              Drop daemon privileges to chosen user after starting.
47
48       -G, --group=group
49              Drop daemon privileges to chosen group after starting.
50
51       -d, --daemon
52              Daemonize program on startup. Not supported on Windows.
53
54       -i, --install-service
55              Installs SMSD as a Windows service.
56
57       -u, --uninstall-service
58              Uninstalls SMSD as a Windows service.
59
60       -s, --start-service
61              Starts SMSD Windows service.
62
63       -k, --stop-service
64              Stops SMSD Windows service.
65
66       -f, --max-failures=count
67              Terminate after defined number of failures. Use 0 to not  termi‐
68              nate (this is default).
69
70       -X, --suicide=seconds
71              Kills itself after number of seconds.
72
73       -S, --run-service
74              Runs  pogram  as  SMSD  Windows service. This should not be used
75              manually, but only Windows Service manager should use this  com‐
76              mand.
77
78       -n, --service-name=name
79              Defines  name  of  a  Windows  service. Each service requires an
80              unique name, so if you want to run several SMSD  instances,  you
81              have to name each service differently. Default is “GammuSMSD”.
82
83       -l, --use-log
84              Use logging as configured in config file (default).
85
86       -L, --no-use-log
87              Do not use logging as configured in config file.
88
89       -e, --install-event-log
90              Installs Windows EventLog description to registry.
91
92              New in version 1.31.90.
93
94
95       -E, --uninstall-event-log
96              Uninstalls Windows EventLog description to registry.
97
98              New in version 1.31.90.
99
100

SIGNALS

102       SMSD  can be controlled using following POSIX signals (if your platform
103       supports this):
104
105       SIGHUP Reload configuration and reconnect to phone.
106
107       SIGINT, SIGTERM
108              Gracefully shutdown the daemon.
109
110       SIGALRM
111              Used internally for gammu-smsd -X
112
113       SIGUSR1
114              Suspends SMSD operation, closing connection to phone  and  data‐
115              base.
116
117       SIGUSR2
118              Resumes SMSD operation (after previous suspend).
119
120       Changed in version 1.22.91: Added support for SIGHUP.
121
122
123       Changed in version 1.22.95: Added support for SIGALRM.
124
125
126       Changed in version 1.31.90: Added support for SIGUSR1 and SIGUSR2.
127
128

EXAMPLES

130   Linux/Unix Examples
131       Start SMSD as a daemon on Linux:
132
133          gammu-smsd --config /etc/gammu-smsdrc --pid /var/run/gammu-smsd.pid --daemon
134
135       Start SMSD as a daemon on Linux with reduced privileges:
136
137          gammu-smsd --config /etc/gammu-smsdrc --pid /var/run/gammu-smsd.pid --daemon --user gammu --group gammu
138
139   SMSD as a system wide daemon
140       To  use  SMSD  as  a daemon, you might want to use init script which is
141       shipped with Gammu in contrib/init directory. It is  not  installed  by
142       default,  either install it manually or check INSTALL file for instruc‐
143       tions.
144
145       Under Windows 7 you might need to disable UAC  (user  account  control)
146       before you will be able to install SMSD service.
147
148   Windows Service Examples
149       Install Gammu SMSD Windows service:
150
151          gammu-smsd.exe -c c:\Gammu\smsdrc -i
152
153       Install two instances of SMSD Windows service:
154
155          gammu-smsd.exe -c c:\Gammu\smsdrc-1 -n Gammu-first-phone -i
156
157          gammu-smsd.exe -c c:\Gammu\smsdrc-2 -n Gammu-second-phone -i
158
159       To uninstall a Windows service:
160
161          gammu-smsd.exe -u
162
163   Troubleshooting Windows Service
164       If  Gammu  fails  to  start  as a Windows service (you will usually get
165       “Error 1053: The service did  not  respond  to  the  start  or  control
166       request  in  a timely fashion”), first check your SMSD logs. If they do
167       not contain any useful hint, try starting SMSD  manually  with  exactly
168       same parameters as you installed the service (without -i).
169
170       For example the command line can look like:
171
172          gammu-smsd.exe -c smsdrc
173
174       You  now  should  be  able  to get errors from SMSD even if it fails to
175       start as a service.
176
177   Invoking Gammu and suspending SMSD
178       As you can not run Gammu and Gammu SMSD at same time on signle  device,
179       you can workaround this limitation by suspending SMSD temporarily using
180       SIGUSR1 and SIGUSR2 signals (see also Signals):
181
182          SMSD_PID=`pidof gammu-smsd`
183          if [ -z "$SMSD_PID" ] ; then
184              echo "Failed to figure out SMSD PID!"
185          else
186              kill -SIGUSR1 $SMSD_PID
187              gammu identify
188              kill -SIGUSR2 $SMSD_PID
189          fi
190
191       Or even create a gammu-safe script:
192
193          #!/bin/bash
194          SMSD_PID=`pidof gammu-smsd`
195          if [ -z "$SMSD_PID" ] ; then
196            gammu $@
197          else
198            tty=$(lsof |grep -E "gammu-sms\s+$SMSD_PID\s+.*/dev/tty*"|awk {'print $NF'})
199            kill -SIGUSR1 $SMSD_PID
200            while test "$(fuser $ttyfuser $tty 2> /dev/null|xargs)" = $SMSD_PID
201            do
202              sleep 1
203            done
204            sleep 1
205            gammu $@
206            kill -SIGUSR2 $SMSD_PID
207            while test "$(fuser $ttyfuser $tty 2> /dev/null|xargs)" != $SMSD_PID
208            do
209              sleep 1
210            done
211            sleep 1
212          fi
213

KNOWN LIMITATIONS

215       You can not use same phone by more programs in same  time.  However  in
216       case you did not enable locking in [gammu] section, it might be able to
217       start the communication with phone from more  programs.  In  this  case
218       neither of the programs will probably work, see Invoking Gammu and sus‐
219       pending SMSD for workaround.
220
221       There is no way to detect that SMS message is reply to another by look‐
222       ing  at  message  headers.  The only way to achieve this is to add some
223       token to the message and let the user include  it  in  the  message  on
224       reply.
225

AUTHOR

227       Michal Čihař <michal@cihar.com>
228
230       2009-2015, Michal Čihař <michal@cihar.com>
231
232
233
234
2351.39.0                           Jan 05, 2018                    GAMMU-SMSD(1)
Impressum