[ Main Page ]

Solaris 10 tips

Solaris 10になってSMF(Service Management Facility)が採用され、管理方法が大分変わったようです。/etc/init.d/ はもう使わないのが普通なようです。

rsync DAEMONを登録

rsyncは/usr/local/binにあるとして、以下の内容を/lib/svc/method に置きます。

#!/bin/sh

# Other options appear in /etc/rsyncd.conf.
RSYNCOPTS="--daemon --bwlimit=1024"

case "$1" in
'start')
        if [ -x /usr/local/bin/rsync
        -a -f /etc/rsyncd.conf -a -f /etc/rsyncd.motd ]; then
        echo "Rsync Daemon starting."
        nice -n -20 /usr/local/bin/rsync ${RSYNCOPTS}
        fi
        ;;
'stop')
        if [ -f /var/run/rsyncd.pid ]; then
        echo "Stopping Rsync Daemon."
        kill -9 `cat /var/run/rsyncd.pid`
        else
        echo "Pid file not found.  Exitting."
        exit 1
        fi
        ;;
'reload')
        if [ -f /var/run/rsyncd.pid ]; then
        kill -HUP `cat /var/run/rsyncd.pid`
        fi
        ;;
'restart')
        /etc/init.d/rsyncd stop
        /etc/init.d/rsyncd start
        ;;
*)
        echo "Usage: /etc/init.d/rsyncd { start | stop | reload | restart }"
        ;;
esac
exit 0
      

次に、/var/svc/manifest/network/sshを参考にしてXMLを書きます。そうしたら、 このサービスを登録します。

# svccfg import ./rsyncd.xml
      

うまくいくとpromptが返ります。登録されたか確認してみます。

# svcs -a|grep rsync
maintenance       18:31:00 svc:/network/rsync:default
      

あとはonlineにすれば起動する筈です。うまく行かなかったら、一旦disableにしてからenableにすればよいでしょう。 困ってしまったら再起動ですが、まずないはずです。

# svcadm enable rsync
# svcs -a|grep rsync
online         18:34:31 svc:/network/rsync:default
    

Securityにもっと気を付けるのであれば、rsyncはそれほど安全とはまだ言い難い面もあるので、zoneを利用して閉じ込める方法なども ある筈ですが、ここでは触れません。

> > On a slightly different note: my machine crashed the other day when
> > using it with kernel 2.6.0. Can anyone help?
> 
> I do not wish to tolerate any reports of problems when using  kernel
> 2.6.0, because I can't tell if it's a bug that was fixed by then, or
> if it's an actual issue with the kernel.

My Commodore 64 is suffering from slowness and insufficiency of memory;
and its display device is grievously short of pixels.  Can anyone help?	

	Shlomi Fish, Muli Ben Yehuda and Omer Zak on
	discussions@hamakor.org.il.

    -- Omer Zak
    -- Post to the Hamakor Discussions Mailing List ( http://mirror.hamakor.org.il/archives/discussions/05-2005/1497.html )

No one knows all of Perl - not even Larry Wall. Except Chuck Norris, who knows
all of Perl 5, Perl 6 and can answer questions about the design of Perl 7.

    -- Shlomi Fish
    -- Chuck 
                      Norris Facts by Shlomi Fish and Friends ( http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/ )


Powered by UNIX fortune(6)
[ Main Page ]