Start gammu service with event.d in Ubuntu Server 8.04

By default when run gammu in Windows I can leave the window by closing it.

Since I must run it in linux I must type and wait :

root@dns:/etc# /gammu 0 –smsd MYSQL /etc/smsdrc
bash: /gammu: is a directory
root@dns:/etc# gammu 0 –smsd MYSQL /etc/smsdrc
Log filename is “/etc/smsdlog”
Press Ctrl+C to stop the program …

Changing inittab instruction in smsdrc file not work for me, searching using google lead me to event.d

Yes, to start gammu in event.d :

root@dns:/etc/event.d# pwd
/etc/event.d
root@dns:/etc/event.d# nano gammu1

Fill this lines :

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on shutdown
respawn
exec /usr/local/bin/gammu 0 –smsd MYSQL /etc/smsdrc 2>&1

Save.

Start gammu service :

root@dns:/etc/event.d# start gammu1
gammu1 (start) waiting
gammu1 (start) starting
gammu1 (start) pre-start
gammu1 (start) spawned, process 11626
gammu1 (start) post-start, (main) process 11626
gammu1 (start) running, process 11626

See status of gammu

root@dns:/etc/event.d# status gammu1
gammu1 (start) running, process 11626

Stop gammu process

root@dns:/etc/event.d# stop gammu1
gammu1 (stop) running, process 11626
gammu1 (stop) pre-stop, (main) process 11626
gammu1 (stop) stopping, process 11626
gammu1 (stop) killed, process 11626
gammu1 (stop) post-stop
gammu1 (stop) waiting

See if gammu is running

root@dns:/service# ps ax | grep gammu
11820 ?        Ss     0:00 /usr/local/bin/gammu 0 –smsd MYSQL /etc/smsdrc
11931 pts/0    R+     0:00 grep gammu