Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread KatolaZ
On Fri, Jan 31, 2020 at 06:39:04PM +, Moisés Simón wrote: > Sorry to hijack, > > Do you know of any basic guide for this? > > I have done a syslog normalizer daemon which calls pledge(), unveil() and > redirects std{out,err} and forks to search and normalize the logs. > > I'm not

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Ingo Schwarze
Hi Patrick, Patrick Kristiansen wrote on Fri, Jan 31, 2020 at 10:17:35AM +0100: > Trying to learn some valuable lessons from our interaction, could you > give some examples of what you mean by 'simpler approach' in this > context? Three examples: https://learnbchs.org/

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Ingo Schwarze
Hi Andrew, Andrew Easton wrote on Fri, Jan 31, 2020 at 11:39:45AM +0100: > In the spirit of not demanding to much time from my contemporaries I > am especially greatful for pointers to conceptual documentation This is the closest thing, i guess: https://www.openbsd.org/events.html In

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Luke Call
The list might not like this but: Under your circumstances, I would collect the various ideas in this thread (including scripting possibly with nohup and/or bash's disown), the "pgrep || " idea somebody wrote, and whatever else is useful from the thread, and just make it work with careful testing

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Kevin Chadwick
On 2020-01-31 12:16, KatolaZ wrote: > For instance, golang has had native support > for pledge(2) and unveil(2) for a while now. The semantics are a little different to C unveil but it certainly works and bundled by default in the golang.org/x. Not sure the documentation is great. It's a little

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread KatolaZ
On Fri, Jan 31, 2020 at 10:47:17AM +0100, Patrick Kristiansen wrote: [cut] > > I would like to get more information about doing application programming > for an OS like OpenBSD. I understand that if you program your > applications in C, you have readily available pledge/unveil, etc. But > many

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Janne Johansson
Den fre 31 jan. 2020 kl 11:48 skrev Andrew Easton : > On Fri, Jan 31, 2020 at 10:47:17AM +0100, Patrick Kristiansen wrote: > > On Fri, Jan 31, 2020, at 09:29, Janne Johansson wrote: > > > Den tors 30 jan. 2020 kl 21:08 skrev Patrick Kristiansen < > patr...@tamstrup.dk>: > > > > > Properly

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Andrew Easton
On Fri, Jan 31, 2020 at 10:47:17AM +0100, Patrick Kristiansen wrote: > On Fri, Jan 31, 2020, at 09:29, Janne Johansson wrote: > > Den tors 30 jan. 2020 kl 21:08 skrev Patrick Kristiansen > > : > > > > Properly starting up a daemon process requires several steps, > > > > often involving

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Patrick Kristiansen
On Fri, Jan 31, 2020, at 09:29, Janne Johansson wrote: > Den tors 30 jan. 2020 kl 21:08 skrev Patrick Kristiansen > : > > > Properly starting up a daemon process requires several steps, > > > often involving unveil(2), pledge(2), chroot(2), prviledge > > > dropping, sometimes fork+exec for

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Patrick Kristiansen
On Thu, Jan 30, 2020, at 23:32, Ingo Schwarze wrote: > In general, size and complexity tend to hurt security, but i know > too little about Java to say how relevant that general rule of thumb > is to the question of running a daemon using a Java Virtual Machine. > For example, Perl 5 is also a

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-31 Thread Janne Johansson
Den tors 30 jan. 2020 kl 21:08 skrev Patrick Kristiansen < patr...@tamstrup.dk>: > > Properly starting up a daemon process requires several steps, often > > involving unveil(2), pledge(2), chroot(2), prviledge dropping, > > sometimes fork+exec for privilege separation, and so on > > The process I

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread Martin Schröder
Am Do., 30. Jan. 2020 um 21:06 Uhr schrieb Patrick Kristiansen : > The process I need to run is written in Clojure and thus runs on the > Java Virtual Machine. Do you have any suggestions on how to best go > about making it "daemon-like"? I am not sure that I can call unveil(2), There is

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread Daniel Dickman
 >> On Jan 30, 2020, at 4:34 PM, Patrick Kristiansen wrote: > On Thu, Jan 30, 2020, at 21:10, Ingo Schwarze wrote: >> Hi Patrick, >> >> Patrick Kristiansen wrote on Thu, Jan 30, 2020 at 09:05:11PM +0100: >> >>> The process I need to run is written in Clojure and thus runs on the >>> Java

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread Ingo Schwarze
Hi Patrick, Patrick Kristiansen wrote on Thu, Jan 30, 2020 at 10:23:52PM +0100: > On Thu, Jan 30, 2020, at 21:10, Ingo Schwarze wrote: >> Patrick Kristiansen wrote on Thu, Jan 30, 2020 at 09:05:11PM +0100: >>> The process I need to run is written in Clojure and thus runs on the >>> Java Virtual

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread KatolaZ
On Thu, Jan 30, 2020 at 09:05:11PM +0100, Patrick Kristiansen wrote: [cut] > > The process I need to run is written in Clojure and thus runs on the > Java Virtual Machine. Do you have any suggestions on how to best go > about making it "daemon-like"? I am not sure that I can call unveil(2), >

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread Patrick Kristiansen
On Thu, Jan 30, 2020, at 21:10, Ingo Schwarze wrote: > Hi Patrick, > > Patrick Kristiansen wrote on Thu, Jan 30, 2020 at 09:05:11PM +0100: > > > The process I need to run is written in Clojure and thus runs on the > > Java Virtual Machine. Do you have any suggestions on how to best go > > about

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread Ingo Schwarze
Hi Patrick, Patrick Kristiansen wrote on Thu, Jan 30, 2020 at 09:05:11PM +0100: > The process I need to run is written in Clojure and thus runs on the > Java Virtual Machine. Do you have any suggestions on how to best go > about making it "daemon-like"? No, i'm sorry i have no advice on that.

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread Patrick Kristiansen
Hi Ingo, On Thu, Jan 30, 2020, at 18:35, Ingo Schwarze wrote: > Hi Patrick, > > Patrick Kristiansen wrote on Tue, Jan 28, 2020 at 09:29:20AM +0100: > > > But another use for daemon(8) is for its ability to detach the child > > process from the controlling terminal and furthermore redirect its >

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-30 Thread Ingo Schwarze
Hi Patrick, Patrick Kristiansen wrote on Tue, Jan 28, 2020 at 09:29:20AM +0100: > But another use for daemon(8) is for its ability to detach the child > process from the controlling terminal and furthermore redirect its > stdout/stderr to syslog. Is there some mechanism to do that from the >

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-29 Thread Christopher Sean Hilton
On Wed, Jan 29, 2020 at 09:46:10AM +, Kevin Chadwick wrote: > On 2020-01-27 19:13, Patrick Kristiansen wrote: > > Is there something like the FreeBSD daemon(8) command for OpenBSD, which > > can run a process in the background and restart it if it crashes? > >

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-29 Thread Kevin Chadwick
On 2020-01-27 19:13, Patrick Kristiansen wrote: > Is there something like the FreeBSD daemon(8) command for OpenBSD, which > can run a process in the background and restart it if it crashes? Of course init does this for getty but as others have pointed out, restarting daemons lis

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-28 Thread Thomas Bohl
But another use for daemon(8) is for its ability to detach the child process from the controlling terminal If it is about a rc.d script, you can add rc_bg=YES to it.

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-28 Thread Marc Chantreux
hello, > PID=`pgrep gloob` > if [ -z "$PID" ]   >      then >     /usr/local/bin/gloob -f poor_security_a_bad_idea_to_run.conf >      fi is there a reason to not use the pgrep status ? pgrep -q gloob || /usr/local/bin/gloob regards, marc

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-28 Thread Allan Streib
You asked about the base image, so maybe there is some reason you can't use it, but Supervisor is in ports/packages. Allan Patrick Kristiansen writes: > Hi everyone, > > Is there something like the FreeBSD daemon(8) command for OpenBSD, which > can run a process in the background

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-28 Thread Martijn van Duren
ind of hackery, but this worked for me quite reliably at the time. martijn@ > > Best regards, > Patrick > >> Hi Patrick, >> >> Patrick Kristiansen wrote on Mon, Jan 27, 2020 at 08:13:28PM +0100: >> >>> Is there something like the FreeBSD daemon(8) c

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-28 Thread Paul de Weerd
Hi Patrick, On Tue, Jan 28, 2020 at 09:29:20AM +0100, Patrick Kristiansen wrote: | Hi Ingo | | Thank you for your reply. | | I can't say I disagree with your and the OpenBSD team's attitude about | bug-free daemons. But I am just a lowly application programmer, and | sometimes I introduce

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-28 Thread Patrick Kristiansen
the shell? Perhaps a combination of nohup and starting a background job? Best regards, Patrick > Hi Patrick, > > Patrick Kristiansen wrote on Mon, Jan 27, 2020 at 08:13:28PM +0100: > >> Is there something like the FreeBSD daemon(8) command for OpenBSD, >> which can run a p

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-27 Thread aisha
On Mon, 27 Jan 2020 22:41:00 +0100, Ingo Schwarze wrote: Hi Patrick, Patrick Kristiansen wrote on Mon, Jan 27, 2020 at 08:13:28PM +0100: Is there something like the FreeBSD daemon(8) command for OpenBSD, which can run a process in the background and restart it if it crashes? Absolute

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-27 Thread dagrichards
0 at 08:13:28PM +0100: > Is there something like the FreeBSD daemon(8) command for OpenBSD, > which can run a process in the background and restart it if it > crashes? Absolutely not, we are strongly convinced this is an utterly stupid idea and a serious security risk. If a daemon cr

Re: FreeBSD daemon(8)-like command for OpenBSD

2020-01-27 Thread Ingo Schwarze
Hi Patrick, Patrick Kristiansen wrote on Mon, Jan 27, 2020 at 08:13:28PM +0100: > Is there something like the FreeBSD daemon(8) command for OpenBSD, > which can run a process in the background and restart it if it > crashes? Absolutely not, we are strongly convinced this is an utter

FreeBSD daemon(8)-like command for OpenBSD

2020-01-27 Thread Patrick Kristiansen
Hi everyone, Is there something like the FreeBSD daemon(8) command for OpenBSD, which can run a process in the background and restart it if it crashes? That is, is there a command that comes with OpenBSD's base image with these capabilities? Surprisingly, Google hasn't revealed anything useful