shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Rodar script como daemon na inicialização


From: Ernander (Nander)
Subject: Re: [shell-script] Rodar script como daemon na inicialização
Date: Thu, 9 Jan 2014 16:42:07 -0200

Trabalho de precuiçoso,

Bota ele no /et/rc.local

Att

Ernander Marcus Lataliza Rosendo
Certified SonicWall Security Professional
Certified SonicWall Security Administrator
CSSP - Certified SonicWALL Security Professional
Visualizar meu perfil no LinkedIn


Em 9 de janeiro de 2014 15:52, <address@hidden> escreveu:
 

Prezados

Possuo o script abaixo:

#!/bin/bash

target_host="miguel"

if [ "`hostname`" != "$target_host" ];then
echo "This daemon runs only on $target_host" >&2
exit -1
fi

if [ "$1" == "start" ];then
op="start"
elif [ "$1" == "stop" ];then
op="stop"
else
echo "usage: `basename $0` <start|stop>" >&2
exit -2
fi


cd /u/user1/producao
exec ./ws sga $op gdsi-miguel



Preciso que o mesmo rode como daemon, na inicilização do meu RHEL 5.5 ou seja, sempre q a maquina inicializa;  Como um serviço qualquer do unix, só que ele precisa rodar com o usuário chamado user1 , e não como root.

Poderiam me ajudar??



reply via email to

[Prev in Thread] Current Thread [Next in Thread]