DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Security

OpenBSD Security Functionally paranoid!

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd September 2017
mefisto mefisto is offline
Shell Scout
 
Join Date: Sep 2017
Posts: 97
Default Running a command/script on boot

Greetings all,

due to my highly developed paranoia, I would like to run the /usr/sbin/syspatch upon boot.

I have perused the FAQ for startup and if I understand it correctly, I can create a script /path/to/run_syspatch:
Code:
#! /bin/sh
/usr/sbin/syspatch
if [ $? -ne 0 ]
then
{
echo "Error, syspatch failed"
}
And them amend /etc/rc.local:
Code:
/path/to/run_syspatch
.
Am I correct, or have I missed something?

Kindest regards,

M
Reply With Quote
  #2   (View Single Post)  
Old 22nd September 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

You can run this directly from within rc.local(8). If /etc/rc.local exists, it is executed with /bin/sh just before starting local daemons. See the last lines of /etc/rc for details.

I use daily(8) with an /etc/daily.local script on my servers, and use the -c option because I still execute syspatch manually. I may need to restart daemons for userland patches or, more freqently lately, I've needed to reboot after a kernel update. And those I want to do in specific server sequence to avoid any operational outages.
Code:
#!/bin/sh
.
.
.
/usr/sbin/syspatch -c
.
.
.

Last edited by jggimi; 22nd September 2017 at 07:46 PM. Reason: corrected man page reference, typos
Reply With Quote
  #3   (View Single Post)  
Old 22nd September 2017
mefisto mefisto is offline
Shell Scout
 
Join Date: Sep 2017
Posts: 97
Default

Hi jiggimi,

thank you.

I obviously do not yet understand the startup enough to realize that I can enter the script into the /etc/rc.local.

Kindest regards,

M
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
matts: a shell script to mail attachments from the command line J65nko Guides 7 3rd August 2022 03:13 AM
Running a command as a different user w/o starting the login shell Carpetsmoker General software and network 4 1st July 2011 10:33 PM
Running a command with input from a file. bigb89 Programming 4 21st January 2009 06:36 PM
Hanging on boot command syscons caesius FreeBSD General 2 28th November 2008 09:07 AM
How launch script or command from icewm? aleunix General software and network 8 8th June 2008 09:12 PM


All times are GMT. The time now is 05:11 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick