DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4th June 2015
EverydayDiesel EverydayDiesel is offline
Shell Scout
 
Join Date: Jan 2009
Posts: 124
Default starting smbd at boot

Can anyone please tell me how to start the samba service at boot time? I added this script to /etc/rc.conf.local and rebooted but it did not work

Code:
if [-x /use/local/libexec/smbd ];  then
  echo -n 'samba'
  /use/local/libexec/smbd /etc/samba/smb.conf 
fi
Also I am use to running a command like ps-ef|grep smbd but this does not work on OpenBSD. I see many options in the man pages but is there a proper way of getting the pids (or seeing is a service is actually running?)

Thanks in advance
Reply With Quote
  #2   (View Single Post)  
Old 4th June 2015
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by EverydayDiesel View Post
Can anyone please tell me how to start the samba service at boot time?
Study Section 10.3 of the FAQ. Hint: set pkg_scripts in /etc/rc.conf.local.
Reply With Quote
  #3   (View Single Post)  
Old 4th June 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

There are many files in the rc(8) subsystem, and you are using the wrong one if you want to run a script.

The rc.conf* files are not scripts, they contain variable setting only. In the past, the files were sourced to set variable values, in modern OpenBSD they are parsed, to enable tools like rcctl(8) to be deployed. You can edit the file manually to set the variables smbd_flag and pkg_scripts, as described in the rc.conf.local(5) man page., or use the rcctl(8) program I just mentioned to set these variables to provision the daemon to start at boot.

The file for manual scripts is rc.local. It isn't used for package daemon starting any longer, since the rc.d(8) system was introduced some years ago.

OpenBSD is a moving target, even though it only moves twice a year.

Last edited by jggimi; 4th June 2015 at 09:58 PM. Reason: typo
Reply With Quote
  #4   (View Single Post)  
Old 4th June 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

FAQ 10.3 has an overview of all the rc(8) files.
Reply With Quote
  #5   (View Single Post)  
Old 4th June 2015
EverydayDiesel EverydayDiesel is offline
Shell Scout
 
Join Date: Jan 2009
Posts: 124
Default

Please excuse my noobness but I am doing something wrong. I noticed from the FAQ that there is a file called /etc/rc.d/samba that is to go in /etc/rc.conf at the bottom line as pkg_scripts=samba

I can see the script starting at boot and I see it with top (smbd) but when I access the share it tells me that it cannot be found. If I start the service and specify the /etc/samba/smb.conf then of works fine. What exactly am I doing wrong here?


Edit : I restarted windows and it started working!

Last edited by EverydayDiesel; 4th June 2015 at 10:34 PM.
Reply With Quote
  #6   (View Single Post)  
Old 4th June 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Glad you got it working.
Quote:
Originally Posted by EverydayDiesel View Post
...that is to go in /etc/rc.conf ...
I hope you meant /etc/rc.conf.local. Editing /etc/rc.conf is not best practice, as you will lose any edits when you upgrade.
Reply With Quote
Reply


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
vsftpd not starting map7 FreeBSD Ports and Packages 1 10th June 2010 09:51 AM
Named not starting on NetBSD boot Antimidget NetBSD General 2 27th August 2009 10:57 PM
Daemon Process not starting on boot map7 FreeBSD General 4 11th September 2008 04:24 PM
Samba NOT STARTING pcfxer FreeBSD General 11 13th May 2008 09:29 AM


All times are GMT. The time now is 05:13 PM.


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