Dewangga Just to add information, about your question, the command to restart service should be after else
### #!/bin/bash if [ -f /var/log/ref_teste ]; then echo "Script was defined - $(date)" | tee -a /var/log/messages echo "Removing $0 from /etc/cron.hourly" | tee -a /var/log/messages echo "### rm -rf /etc/cron.hourly/$0" | tee -a /var/log/messages else echo "TEST ### $(date) ###" | tee -a /var/log/messages # Command here !!!! service xpto_daemon restart touch /var/log/ref_teste fi ### ______________ Atenciosamente Waldirio msn: [email protected] Skype: waldirio Site: www.waldirio.com.br Blog: blog.waldirio.com.br LinkedIn: http://br.linkedin.com/pub/waldirio-pinheiro/22/b21/646 PGP: www.waldirio.com.br/public.html On Thu, Oct 16, 2014 at 1:18 AM, Waldirio Manhães Pinheiro < [email protected]> wrote: > Hello Dewangga and list friends, good morning > > By default the Spacewalk don't have this feature, btw you can do things > like bellow: > > 1. Create a rpm just to do what you need, so you configure in conf. > channel the package and the command will be executed (I know, I don't like > too, but it work). > > 2. Create a script like bellow in /etc/cron.hourly. Sure you will change, > remove comments and define to your environment, but this will work too. The > command will not be execute at the same time of deploy, but on the next 01 > minute of next hour. > > ### > #!/bin/bash > if [ -f /var/log/ref_teste ]; then > echo "Script was defined - $(date)" | tee -a /var/log/messages > echo "Removing $0 from /etc/cron.hourly" | tee -a /var/log/messages > echo "### rm -rf /etc/cron.hourly/$0" | tee -a /var/log/messages > else > echo "TEST ### $(date) ###" | tee -a /var/log/messages > touch /var/log/ref_teste > fi > ### > > I'll prepare a real sample and create a post in my blog. Good question! ;-) > > Take Care and let me know if work to you. > > ______________ > Atenciosamente > Waldirio > msn: [email protected] > Skype: waldirio > Site: www.waldirio.com.br > Blog: blog.waldirio.com.br > LinkedIn: http://br.linkedin.com/pub/waldirio-pinheiro/22/b21/646 > PGP: www.waldirio.com.br/public.html > > On Thu, Oct 16, 2014 at 12:19 AM, Dewangga Bachrul Alam < > [email protected]> wrote: > >> Hi, >> >> I've try to centralize SSL Configuration Files, (eg. >> /etc/nginx/conf.d/ssl.conf), but, after changes that files, I should >> reload the nginx automatically after deployed the files. >> >> I add action chaining manually to deployment schedule, is it possible to >> automate them? I mean that remote command `service nginx reload` saved >> on configuration files too. >> >> Is it possible? >> >> _______________________________________________ >> Spacewalk-list mailing list >> [email protected] >> https://www.redhat.com/mailman/listinfo/spacewalk-list >> > >
_______________________________________________ Spacewalk-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/spacewalk-list
