ロボット、サーバーの事などをたまに更新。

memo

You are here:  home arrow etc arrow fedora arrow Antivirをインストールする2 - fedora7
Antivirをインストールする2 - fedora7
2007/10/25 木曜日 23:46:19 JST

prelink.confを編集する

これやらないとantivirなどのバイナリファイルが書き換えられ、その状態でantivirを起動すると「error (program file of AntiVir has been modified):」って怒られちまいます。

$ su -c 'vi /etc/prelink.conf'
リストの一番下に下記を追記
-b /usr/lib/AntiVir

  

AntiVirのインストール

http://www.free-av.com/からプログラムをダウンロードする。現時点でのバージョンは2.1.11-21

$ tar -xzvf antivir-workstation-pers.tar.gz
$ cd antivir-workstation-pers
$ su -c './install'
だいたいyesで進んでいく。

.......

Note: Dazuko currently only works with GNU/Linux, FreeBSD and Solaris
      systems. If you are interested in helping us port Dazuko to
      OpenBSD, feel free to check out the Dazuko Project at:
      http://www.dazuko.org
 
available options: m k n
 
How should AvGuard be installed? [k] m <- `m`を選択

......

Enter the full path to dazuko.ko: /lib/modules/2.6.22.1-21.fc7_DAZUKO/extra/dazuko.ko
モジュールの場所を指定 ※1

........

Be sure to read the README file for additional information.
Thank you for your interest in Avira AntiVir Workstation (UNIX).

END

これで完了。

※1) 後述の作成したスクリプトでdazuko.koを有効にするので、あまり設定に意味は無いかもしれませぬ。

 

ユーザーグループを編集

インストーラよりantivirがグループに追加されます。このグループにantivirを使用するユーザーを追加します。

$ su -c 'gpasswd -a username antivir'

一度、ログアウトして再度、ログインする。 

 

GUI版を起動してみる

javaで構成されているみたいです。GCJ、本家JAVAのどちらを使用しても動作に問題はないようです。

ではでは、`antivir-gui`で起動します。

bash-3.2$ antivir-gui

ERROR: Can't connect to an X server. Please try the following:

- generate or merge `.Xauthority'. You can merge with:
  $ xauth merge <path-to-user-with-X-rights>/.Xauthority

左様でございますか。

$ touch ~/.Xauthority

これで、無事起動することができました。

Image

 

起動スクリプトを修正

antivirのインストーラにより/etc/rc(0-6).dに起動スクリプトが直に設置されます。しかし、起動は問題なかったのに再起動&シャットダウン時に「Sending all processes the TERM signal...」で止まってしまうようになるんですよ。再起動、終了の度にPCのリセットボタンを押していたらタマランので、起動スクリプトを作成しました。

既存のスクリプトを削除
$ su -c 'rm /etc/rc?.d/S20av*'
$ su -c 'rm /etc/rc?.d/K80av*'

 

  1. #!/bin/sh
  2. #
  3. # avguard Start/Stop AvGuard
  4. #
  5. # chkconfig: 2345 20 80
  6. # description: AntiVir Workstation
  7.  
  8. PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/lib/AntiVir"
  9.  
  10. # Source function library.
  11. . /etc/rc.d/init.d/functions
  12.  
  13. antivir=/usr/lib/AntiVir/antivir
  14. prog=avguard
  15. module=dazuko
  16. pidfile=/var/run/avguard.pid
  17. lockfile=/var/lock/subsys/${prog}
  18. options="--updater-daemon"
  19. GUARD_TYPE="workstation"
  20. RETVAL=0
  21.  
  22. check_module() {
  23.  
  24. if [ -z "`lsmod | grep ^dazuko`" ]; then
  25. modprobe dazuko >/dev/null 2>&1
  26. fi
  27.  
  28. if [ ! -e /dev/dazuko ]; then
  29. mknod -m 600 /dev/dazuko c `grep dazuko /proc/devices | sed "s/ .*//"` 0
  30. fi
  31. }
  32.  
  33. start() {
  34. echo -n $"Starting $prog: "
  35. check_module || exit 1
  36. daemon $antivir --${GUARD_TYPE} && daemon $antivir $options
  37. RETVAL=$?
  38. echo
  39. [ $RETVAL = 0 ] && touch ${lockfile} ${pidfile}
  40. return $RETVAL
  41. }
  42.  
  43. stop() {
  44. echo -n $"Stopping $prog: "
  45. killproc $antivir
  46. RETVAL=$?
  47. echo
  48. [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
  49. }
  50.  
  51. restart() {
  52. stop
  53. start
  54. }
  55.  
  56. reload() {
  57. restart
  58. }
  59.  
  60. force_reload() {
  61. restart
  62. }
  63.  
  64. status $antivir >/dev/null
  65. running=$?
  66.  
  67. case "$1" in
  68. start)
  69. [ $running = 0 ] && exit 0
  70. start
  71. ;;
  72. stop)
  73. stop
  74. ;;
  75. status)
  76. status $antivir
  77. ;;
  78. restart)
  79. restart
  80. ;;
  81. reload|force-reload|condrestart|try-restart)
  82. restart
  83. ;;
  84. *)
  85. echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
  86. exit 2
  87. esac
  88.  
  89. exit $RETVAL
 

アップデーターもまとめて起動しているとか色々ツッコミどころはあるかとおもいますが・・・

これをFedoraのサービスとして登録します。しちゃいます。

作成したスクリプト(下記ではavguard)を設置
# cp avguard /etc/rc.d/init.d/ ; chmod 755 /etc/rc.d/init.d/avguard ; chown root:root /etc/rc.d/init.d/avguard
# chkconfig --add avguard

これにて、再起動&シャットダウン時のトラブルが解決しました。ヨカッタネ。

 

 


Tags:  etc Fedora7 Antivirをインストールする2
最終更新日 ( 2007/11/12 月曜日 15:38:31 JST )