Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: william_syd on September 09, 2006, 04:03:18 PM

Title: configuration db and chkconfig
Post by: william_syd on September 09, 2006, 04:03:18 PM
Whats the relationship between the configuration db and chkconfig in regards to services ?
Title: configuration db and chkconfig
Post by: byte on September 09, 2006, 04:13:43 PM
I don't think there is a relationship because of the way sme works, don't quote me on it as I may be incorrect.
Title: Re: configuration db and chkconfig
Post by: raem on September 10, 2006, 12:41:41 AM
william_syd

Perhaps these are of interest

http://cr.yp.to/daemontools.html
http://cr.yp.to/daemontools/svc.html
http://cr.yp.to/daemontools/supervise.html
Title: Re: configuration db and chkconfig
Post by: CharlieBrady on September 14, 2006, 07:01:30 PM
Quote from: "william_syd"
Whats the relationship between the configuration db and chkconfig in regards to services ?


chkconfig is not used in SME server, and will not be effective if you try to use it.
Title: configuration db and chkconfig
Post by: william_syd on October 11, 2006, 11:14:01 AM
Thanks CharlieBrady.

Thats what I thought.

However supervise/runit is giving me difficulty.

I'm attempting to run a program(mpg123) at startup using supervise(runit)

So far I have,

Created directory
Code: [Select]
/var/service/mpg123
and
Code: [Select]
/var/service/mpg123/log

In the newly created directories placed a run file consisting of

Code: [Select]
#!/bin/sh

exec 2>&1

exec /usr/sbin/mpg123 /root/music.mp3


and

Code: [Select]
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 1999-2003 Mitel Networks Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
# Technical support for this program is available from Mitel Networks
# Please visit our web site www.mitel.com for details.
#----------------------------------------------------------------------
exec                                    \
    /usr/local/bin/setuidgid smelog     \
    /usr/local/bin/multilog t s5000000  \
    /var/log/mpg123

   
I also created
Code: [Select]
/var/log/mpg123
I created a db entry
Code: [Select]
db configuration set mpg123 service status enabled
and the following symbolic links
Code: [Select]
ln -s /var/service/mpg123 /service/mpg123
ln -s /etc/rc.d/init.d/daemontools /etc/rc.d/init.d/supervise/mpg123

and finally
Code: [Select]
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S98mpg123
The result of
Code: [Select]
/etc/rc7.d/S98mpg123 start
is
Code: [Select]
Starting mpg123:                                           [  OK  ]

yet there is no sound.

So, what have I left out?
Do I still need a init script?
What signal-event's should I be doing?

BTW,
Code: [Select]
/usr/sbin/mpg123 /root/music.mp3
does produce music.
Code: [Select]
[root@tiger ~]# /usr/sbin/mpg123 /root/music.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 0.60; written and copyright by Michael Hipp and others
        free software (LGPL/GPL) without any warranty but with best wishes

Directory: /root/
Playing MPEG stream 1 of 1: music.mp3 ...
[id3.c:198] error: ID3v2: non-syncsafe frame size, aborting

        Title:   My Life
        Artist:  Billy Joel
        Album:   Greatest Hits Vol.1 & 2 [UK] Disc 2
        Year:
        Genre:   Rock/Pop
        Comment:

MPEG 1.0 layer III, 128 kbits/s, 44100 Hz joint-stereo


The desire to do this started here (http://forums.contribs.org/index.php?topic=34075.0) and here. (http://www.unixuser.org/~euske/doc/daemontools/mp3play-e.html)
Title: configuration db and chkconfig
Post by: william_syd on October 11, 2006, 03:32:15 PM
Wow, the above does work.

Had a typo in my run script that the log file revealed.
Code: [Select]
exec /user/sbin/mpg123 /root/music.mp3

Well, rebooted, music started, song finished and song restarted.

Now I have to get it working with a playlist and reduce the amount of 'log noise'.

Plus put it into a howto including permissions of the files.