Auto starting smbd and minidlna at boot time

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

Auto starting smbd and minidlna at boot time

Postby hetfield » Tue Nov 05, 2013 3:11 pm

A newbie question... apologies if it has been asked previously. But I've been searching the forums in vain for quite a few days.

Using ArchLinuxARM (3.11.6.1) on GFH. Automounting my two drives (3TB on SATA & 2TB on USB). The problem I have is that - I have to manually restart smbd and minidlna every time I boot the GFH. Systemctl status shows smbd running with a few errors regarding the printer (which I don't use with GFH) and minidlna NOT running.

So far I've tried:
  • using systemctl start for both of these (smbd & minidlna)
  • using systemctl enable for both of these (smbd & minidlna)
  • enabling and disabling NetworkManager-wait-online
  • trying to create a /etc/rc.conf which appears to not have been read by alarm in favour of systemd

My systemd startup services are registered as:

$this->bbcode_second_pass_code('', 'total 8
drwxr-xr-x 2 root root 4096 Nov 5 21:37 .
drwxr-xr-x 4 root root 4096 Jul 27 02:20 ..
lrwxrwxrwx 1 root root 39 Aug 8 06:07 haveged.service -> /usr/lib/systemd/system/haveged.service
lrwxrwxrwx 1 root root 40 Sep 30 16:25 minidlna.service -> /usr/lib/systemd/system/minidlna.service
lrwxrwxrwx 1 root root 47 Jul 27 02:24 netctl-ifplugd@eth0.service -> /usr/lib/systemd/system/netctl-ifplugd@.service
lrwxrwxrwx 1 root root 36 Sep 28 23:10 nmbd.service -> /usr/lib/systemd/system/nmbd.service
lrwxrwxrwx 1 root root 40 Oct 25 07:45 remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 36 Sep 28 23:10 smbd.service -> /usr/lib/systemd/system/smbd.service
lrwxrwxrwx 1 root root 36 Jul 27 02:21 sshd.service -> /usr/lib/systemd/system/sshd.service
')

My smb.conf (actually testparm output) is below:

$this->bbcode_second_pass_code('', '[global]
netbios name = NAS
server string = GoflexHome
interfaces = lo, eth0
bind interfaces only = Yes
map to guest = Bad User
log file = /var/log/samba/%m.log
max log size = 50
name resolve order = bcast, host
dns proxy = No
idmap config * : backend = tdb
create mask = 0664
force create mode = 0664
directory mask = 0777
force directory mode = 0777

[3TB]
path = /media/storage
read only = No
guest only = Yes
guest ok = Yes

[2TB]
path = /media/storage2
read only = No
guest only = Yes
guest ok = Yes
')
hetfield
 
Posts: 13
Joined: Mon Oct 07, 2013 6:36 am

Re: Auto starting smbd and minidlna at boot time

Postby WarheadsSE » Tue Nov 05, 2013 6:33 pm

COPY the .service files to their destination, (this enables them), and add a requirement for them to wait on the mounting of the drives to complete.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Auto starting smbd and minidlna at boot time

Postby hetfield » Tue Nov 05, 2013 11:25 pm

Thanks for the reply WarheadsSE.
$this->bbcode_second_pass_quote('', 'C')OPY the .service files to their destination, (this enables them)

I can see both smbd.service and minidlna.service currently copied into /usr/lib/systemd/system/ directory. Would I need to copy them again? If yes, from where?
$this->bbcode_second_pass_quote('', 'a')nd add a requirement for them to wait on the mounting of the drives to complete

Currently my drives are mounted from fstab. Can you please show me how to add a wait on the service start for drive mounting? My fstab is below:
$this->bbcode_second_pass_code('', '# /etc/fstab: static file system information
# <file system> <dir> <type> <options> <dump> <pass>
LABEL=rootfs / ext2 defaults,rw,noatime 0 1
/dev/sda2 none swap defaults 0 0
/dev/sda3 /media/storage ext4 defaults,rw,noatime 0 0
LABEL=USB /media/storage2 ext4 defaults,rw,noatime,nofail 0 0
')
hetfield
 
Posts: 13
Joined: Mon Oct 07, 2013 6:36 am

Re: Auto starting smbd and minidlna at boot time

Postby hetfield » Thu Nov 21, 2013 12:06 pm

Any recommendation, anyone?
hetfield
 
Posts: 13
Joined: Mon Oct 07, 2013 6:36 am

Re: Auto starting smbd and minidlna at boot time

Postby haiku » Mon Nov 25, 2013 7:16 am

Hi,
Haven't tested it yet but : edit your minidlna.service and add After=local-fs-pre.target option
haiku
 
Posts: 96
Joined: Tue May 31, 2011 6:34 am

Re: Auto starting smbd and minidlna at boot time

Postby hetfield » Mon Nov 25, 2013 7:50 am

Thanks for the response. Tried that but still have to manually start these services every time I reboot the GFH.

My current 'minidlna.service' is:

$this->bbcode_second_pass_code('', '[Unit]
Description=minidlna server
After=local-fs-pre.target
;After=network.target

[Service]
Type=forking
User=nobody
ExecStart=/usr/bin/minidlnad -P /run/minidlna/minidlna.pid
PIDFile=/run/minidlna/minidlna.pid

[Install]
WantedBy=multi-user.target
')

And the current 'smbd.service' is:

$this->bbcode_second_pass_code('', '[Unit]
Description=Samba SMB/CIFS server
After=local-fs-pre.target
; After=network.target nmbd.service winbindd.service

[Service]
Type=forking
PIDFile=/var/run/smbd.pid
ExecStart=/usr/bin/smbd -D
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
')
hetfield
 
Posts: 13
Joined: Mon Oct 07, 2013 6:36 am

Re: Auto starting smbd and minidlna at boot time

Postby moonman » Mon Nov 25, 2013 10:00 am

you might want to append it to the end of After list. Getting rid of other targets doesn't help.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Auto starting smbd and minidlna at boot time

Postby hetfield » Mon Nov 25, 2013 12:15 pm

$this->bbcode_second_pass_quote('moonman', 'y')ou might want to append it to the end of After list. Getting rid of other targets doesn't help.


Thanks for the replies so far everyone. done the above, but still have to manually restart both services :?

My revised 'minidlna.service' is now:
$this->bbcode_second_pass_code('', '[Unit]
Description=minidlna server
After=network.target
After=local-fs-pre.target

[Service]
Type=forking
User=nobody
ExecStart=/usr/bin/minidlnad -P /run/minidlna/minidlna.pid
PIDFile=/run/minidlna/minidlna.pid

[Install]
WantedBy=multi-user.target')

& my revised 'smbd.service' is now:
$this->bbcode_second_pass_code('', '[Unit]
Description=Samba SMB/CIFS server
After=network.target nmbd.service winbindd.service
After=local-fs-pre.target

[Service]
Type=forking
PIDFile=/var/run/smbd.pid
ExecStart=/usr/bin/smbd -D
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target')
hetfield
 
Posts: 13
Joined: Mon Oct 07, 2013 6:36 am
Top

Re: Auto starting smbd and minidlna at boot time

Postby haiku » Tue Nov 26, 2013 7:09 am

Look's good.. Did you edit /usr/lib/systemd/system/minidlna.service ?
You might 'systemctl disable minidlna' then enable to make the change.
haiku
 
Posts: 96
Joined: Tue May 31, 2011 6:34 am

Re: Auto starting smbd and minidlna at boot time

Postby hetfield » Tue Nov 26, 2013 8:10 am

$this->bbcode_second_pass_quote('haiku', 'D')id you edit /usr/lib/systemd/system/minidlna.service ?


Yes

$this->bbcode_second_pass_quote('haiku', 'Y')ou might 'systemctl disable minidlna' then enable to make the change.


Tried that but that didn't work too. The samba shares aren't visible until I manually do a 'systemctl restart smbd' and also the minidlna doesn't work until I manually do a 'systemctl restart minidlna'.

Both services magically start working as soon as I do these steps. I only have to restart my device two or three times a week - only when it somehow becomes inaccessible - and doing these manual steps is not really a big deal but it's a pain in the neck nevertheless.

After having done all the complicated work - like installing ArchLinuxARM and using a 3TB SATA HDD to boot the device through reading some very helpful posts on this forum, this annoyance has still got me perplexed for months now. :?
hetfield
 
Posts: 13
Joined: Mon Oct 07, 2013 6:36 am
Top

Next

Return to ARMv5

Who is online

Users browsing this forum: No registered users and 1 guest