[ 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を利用して閉じ込める方法なども ある筈ですが、ここでは触れません。

  <yacoob>  a quickie: are 'adjustments layers' planned to be implemented
            in gimp?
   <nomis>  yacoob: at some point in the future, yes.
  <yacoob>  nomis: dare to estimate how far this future is?
   <nomis>  yacoob: no.
 <rindolf>  yacoob: faster if you contribute.
         *  nomis waits for the "oh, I cannot program at all".
 <rindolf>  nomis: faster if he learns how to program, and then
            contributes.
   <nomis>  :)
  <yacoob>  rindolf: you wouldn't like me to contribute, believe me ;)

    -- Faster, faster!
    -- #gimp, GimpNet

The people I've met who do great work... generally feel that they're stupid
and lazy, that their brain only works properly one day out of ten, and that
it's only a matter of time until they're found out.

Paul Graham
["Great Hackers" (later edited out)](http://xrl.us/ho9c)

    -- Paul Graham
    -- "Great Hackers" (old Version) ( http://xrl.us/ho9c )


Powered by UNIX fortune(6)
[ Main Page ]