Start gammu service with event.d in Ubuntu Server 8.04

Recommended VPS for your FreeBSD or Linux Server + Custom Iso Allowed (Free $20 credit for limited time, grab it now)

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 :

[email protected]:/etc# /gammu 0 –smsd MYSQL /etc/smsdrc
bash: /gammu: is a directory
[email protected]:/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 :

[email protected]:/etc/event.d# pwd
/etc/event.d
[email protected]:/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 :

[email protected]:/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

[email protected]:/etc/event.d# status gammu1
gammu1 (start) running, process 11626

Stop gammu process

[email protected]:/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

[email protected]:/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