Rc skripty
Miroslav Lachman
000.fbsd at quip.cz
Fri Sep 23 11:10:31 CEST 2011
Tomas Zajpt wrote:
> name="smsd"
> rcvar=`set_rcvar`
> pidfile="/var/run/${name}.pid"
> required_files="/usr/local/etc/gnokiirc"
> command="/usr/local/sbin/smsd"
> command_args="$smsd_flags"
>
> load_rc_config $name
> eval "${rcvar}=\${${rcvar}:-'NO'}"
>
> run_rc_command "$1"
>
> Problem je ten, ze to nefunguje. Pokud si stejny prikaz pustim v cmd,
> tak jede krasne. Pokud pustim tento skript pres /usr/local/etc/smsd
> start, tak se to pusti take, ale v poppredi. Zkousel jsem tam pridavat
> do $command nohup, ale myslim, ze tudy cesta nevede. Bohuzel smsd
> neumi bezet v deamon modu. Jde to nejak jednoduse vyresit?
No muzes ten prikaz poslat na pozadi pridanim "&" na konec a nebo to
zkusit pomoci /usr/sbin/daemon
Pouziva ho tak treba rc script pro mysql:
command="/usr/sbin/daemon"
command_args="-c -f /usr/local/bin/mysqld_safe
--defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user}
--datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
procname="/usr/local/libexec/mysqld"
Mirek
More information about the Users-l
mailing list