[Tomoyo-dev 650] Re: man について( Re: alien ほか

Back to archive index

yocto yocto****@gmail*****
2007年 10月 21日 (日) 17:53:51 JST


クスノです。

ライセンスの件ではないですが、manpageはこれなら簡単でいいですね。

元々それぞれのコマンドオプションが一般的な記述ではないので"--version"位はあった方が
いいと思いますが、どうでしょうか。

#SELinuxも一般的じゃないですね...う〜ん

07/10/19 に from-****@i-lov*****
<from-****@i-lov*****> さんは書きました:
>  熊猫です。
>
> man ページですが、 help2man を使って作成することにしようと思います。
> 普通じゃない使い方だとは思いますが、ソースコードの修正だと小回りがきかないので
> help2man の動作に必要な情報を表示するだけのスクリプトを作成してみました。
>
> 以下のスクリプトを loadpolicy という名前で保存して ./loadpolicy のように実行すると
> /usr/share/man/man8/loadpolicy.8.gz が作成されます。
> 免責・ライセンス表示の文章をどうしたらよいのか考え中ですが、何かコメントがあればお願いします。
>
> ---------- loadpolicy ----------
> #! /bin/sh
>
> if [ "$1" = "--version" ]
> then
> cat << EOF
> loadpolicy 1.5.1
>
> Copyright (C) 2005-2007 NTT DATA CORPORATION.
>
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License. This program has absolutely no warranty.
> EOF
> elif [ "$1" = "--help" ]
> then
> cat << EOF
> Usage: loadpolicy [-][s][e][d][a][f][p][m]
>
> This program loads TOMOYO Linux's policy from files or standard input into kernel.
>
>  -     Read policy from stdin. Specify only one of "sedpm" option when you use this option.
>
>  s     Load system_policy. ( /etc/ccs/system_policy.conf )
>
>  e     Load exception_policy. ( /etc/ccs/exception_policy.conf )
>
>  d     Load domain_policy. ( /etc/ccs/domain_policy.conf )
>
>  a     Load system_policy, exception_policy and domain_policy.
>
>  p     Load profile. ( /etc/ccs/profile.conf )
>
>  m     Load manager. ( /etc/ccs/manager.conf )
>
>  f     Erase on-memory policy before loading on-disk policy. If not specified, on-disk policy is appended to on-memory policy.
>        This option is valid for "seda" options.
>
> Examples:
>
>  # echo "allow_read /proc/meminfo" | loadpolicy -e     Add "allow_read /proc/meminfo" to exception policy.
>  # echo "delete allow_read /proc/meminfo" | loadpolicy -e     Remove "allow_read /proc/meminfo" from exception policy.
>  # ( echo "<kernel>"; echo "1 /sbin/init" ) | loadpolicy -d    Add "1 /sbin/init" to "<kernel>" domain.
>  # loadpolicy df    Replace currently loaded domain policy with /etc/ccs/domain_policy.conf .
>  # loadpolicy d     Append /etc/ccs/domain_policy.conf into currently loaded domain policy.
>
> Report bugs to <pengu****@I-lov*****>.
>
> EOF
> else
> cat << EOF | help2man -i - -N -s 8 -n "Load TOMOYO Linux's policy" $0 | gzip -9 > /usr/share/man/man8/loadpolicy.8.gz
> [SEE ALSO]
>  /sbin/ccs-init (Policy loader automatically invoked when /sbin/init starts.)
>
> [NOTES]
>
> You need to register either path to this program ( /usr/lib/ccs/loadpolicy ) or a domain for this program in /proc/ccs/manager before invoking this program.
>
> You may create a symbolic link to this program named ccs-loadpolicy if you wish.
>
> [AUTHORS]
> NTT DATA CORPORATION, Japan.
>
> EOF
> fi
> exit 0
>
> _______________________________________________
> tomoyo-dev mailing list
> tomoy****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/tomoyo-dev
>




tomoyo-dev メーリングリストの案内
Back to archive index