# how to start Kannel daemon at boot time?



## sugar (Dec 15, 2008)

Hello guys, I've added the line *kannel_enable="YES"* to */etc/rc.conf* in order to have the Kannel to start automatically when the system boots.

Then a user of Kannel mailing list told me this: 
_Try asking BSD mail groups how to set up init scripts in BSD. As far as the rest of Unices, you move the script in /etc/init.d and make an S* link from your default runlevel (rc3.d) -> ../init.d/kannel.
_

So did I something wrong?

Thanks in advance.


----------



## ale (Dec 15, 2008)

What has been suggested is not valid for FreeBSD.
Adding the line you added in /etc/rc.conf is the correct way yo have it started at boot.
Now try 
	
	



```
/usr/local/etc/rc.d/kannel start
/usr/local/etc/rc.d/kannel status
```


----------



## sugar (Dec 15, 2008)

Let me know if I understood, shold I add the lines */usr/local/etc/rc.d/kannel start
/usr/local/etc/rc.d/kannel statu*s to the */etc/rc.conf* ? or is ok with the *kannel_enable="YES"*

This is the output:

```
radius# /usr/local/etc/rc.d/kannel start
kannel_bearerbox already running? (pid=643).
kannel_smsbox already running? (pid=654).
kannel_wapbox already running? (pid=665).

radius# /usr/local/etc/rc.d/kannel status
kannel_bearerbox is running as pid 643.
kannel_smsbox is running as pid 654.
kannel_wapbox is running as pid 665.
```

Thanks


----------



## ale (Dec 15, 2008)

You have to add _kannel_enable="YES"_ in _/etc/rc.conf_ , and it seems that you have done it yet.
This will let start the daemon at every boot.

The 1st line I've posted (...kannel start) is to start it manually.
Useful, for example, if you have just installed it and you want to start it without rebooting.
The 2nd, is to check the status.
As you can see from the output of the two commands, kennel is yet successfully running.
To make it clear, you don't have to put this lines in a file, you can just run them from a console.


----------



## sugar (Dec 15, 2008)

It worked like a charm!... 
One more thing, due a buggy port kannel port for FreeBSD i had to create manually the user kannel , I created it with no password... is that correct? or how can I have the kannel daemon to run as root? Look my 'top' output it shows all running as root but kannel...


```
PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
  747 root        1  96    0 26956K 14028K select 1   0:00  0.00% httpd
  737 mysql      10  96    0 62148K 20828K ucond  1   0:00  0.00% mysqld
  644 kannel     13  96    0 16916K  3860K ucond  0   0:00  0.00% bearerbox
  688 root        1  96    0  5892K  2344K select 0   0:00  0.00% nmbd
  831 root        1  96    0  3448K  2632K select 0   0:00  0.00% proftpd
  846 root        1   4    0  8384K  3828K sbwait 0   0:00  0.00% sshd
  666 kannel      9  96    0 16404K  3804K select 1   0:00  0.00% wapbox
  853 root        1  20    0  5476K  2548K pause  0   0:00  0.00% csh
  849 aldo        1  96    0  8384K  3844K select 1   0:00  0.00% sshd
  699 root        1  96    0  7680K  5728K select 0   0:00  0.00% perl5.8.8
  692 root        1  96    0  8088K  3752K select 0   0:00  0.00% smbd
  532 root        1  96    0  3156K  1196K select 1   0:00  0.00% syslogd
  884 root        1  96    0  3488K  1792K CPU0   0   0:00  0.00% top
  852 aldo        1   8    0  3592K  1564K wait   1   0:00  0.00% su
  712 mysql       1   8    0  3456K  1432K wait   0   0:00  0.00% sh
  851 aldo        1   8    0  3456K  1488K wait   1   0:00  0.00% sh
  765 root        1  96    0  5848K  3188K select 0   0:00  0.00% sendmail
  654 kannel      1   8    0  7188K  2204K nanslp 0   0:00  0.00% run_kannel_box
  818 root        1   5    0  3156K  1064K ttyin  1   0:00  0.00% getty
  671 root        1  96    0  3284K  2304K select 1   0:00  0.00% proftpd
  775 root        1   8    0  3184K  1248K nanslp 0   0:00  0.00% cron
  825 root        1   5    0  3156K  1064K ttyin  0   0:00  0.00% getty
  821 root        1   5    0  3156K  1064K ttyin  1   0:00  0.00% getty
  824 root        1   5    0  3156K  1064K ttyin  0   0:00  0.00% getty
  819 root        1   5    0  3156K  1064K ttyin  1   0:00  0.00% getty
  822 root        1   5    0  3156K  1064K ttyin  1   0:00  0.00% getty
  820 root        1   5    0  3156K  1064K ttyin  0   0:00  0.00% getty
  827 www         1   4    0 26956K 14052K accept 0   0:00  0.00% httpd
  823 root        1   5    0  3156K  1064K ttyin  1   0:00  0.00% getty
  826 www         1   4    0 26956K 14052K accept 0   0:00  0.00% httpd
  828 www         1   4    0 26956K 14052K accept 1   0:00  0.00% httpd
  790 www         1   4    0 13332K  9216K accept 1   0:00  0.00% httpd
  829 www         1   4    0 26956K 14052K accept 0   0:00  0.00% httpd
  759 root        1  96    0  5616K  3160K select 0   0:00  0.00% sshd
  830 www         1   4    0 26956K 14052K accept 0   0:00  0.00% httpd
  769 smmsp       1  20    0  5848K  3220K pause  0   0:00  0.00% sendmail
  665 kannel      1   8    0  7188K  2140K wait   0   0:00  0.00% run_kannel_box
  643 kannel      1   8    0  7188K  1856K wait   0   0:00  0.00% run_kannel_box
  738 root        6  96    0  7036K  3292K uwait  0   0:00  0.00% radiusd
  463 root        1  96    0  1888K   544K select 1   0:00  0.00% devd
```


----------



## ale (Dec 15, 2008)

Why do you want to run it as root?
In your top I can also see mysqld running as mysql and httpd as www, ...
You should make sure that the user kannel has /usr/sbin/nologin as default shell and eventually fix it using chsh or chpass or vipw


----------

