Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 535.7K On-Premises Infrastructure
- 138.1K Analytics Software
- 38.6K Application Development Software
- 5.6K Cloud Platform
- 109.3K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
switch user rc.local

Robeen
Member Posts: 2,175 Silver Badge
Redhat Hat Linux 7
Hello Team,
I would like to aotoexecute a script after server reboot. I have scheduled it in /etc/rc.d/rc.local.
But I see it is executing as root user.
rc.local entry:
sh /home/ora12c/scripts/autostart.sh
How do I execute as ora12c user?
content of autostart.sh:
nohup ./server.sh &
Thanks,
Roshan
Answers
-
Hi
Change autostart.sh to:
su - ora12c -c nohup /home/ora12c/scripts/server.sh &
Regards,
Nik