Author Topic: VSIDO Server  (Read 4330 times)

lwfitz

  • DEFCON 1
  • Posts: 1778
  • sudo rm -rf /
    • View Profile
VSIDO Server
« on: July 13, 2013, 05:24:44 PM »
I have an old Dell that I turned into an office file and ftp server and figured that would be a great stability/efficiency test for VSDIO.

Initially I had some concerns about memory usage with a 64 bit install but am now convinced I should never doubt VastOne. This server has been running for a month now and with an uptime of 14 days
and a 170mb memory usage.

I havent seen any stability issues whatsoever and have not had one glitch when connecting to or downloading from it.


The only thing that I have an issue with is lightdm and samba integration. From what I can tell Samba needs a login manager to start properly and I would love to be able to have this machine
boot up to a console rather than with a gui.

All in all this project is 99.9% perfect. Thanks again VastOne for all the time an effort you have put into VSIDO.
Don't Be A Dick!

PackRat

  • Posts: 2255
    • View Profile
    • PackRat configs on github
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

lwfitz

  • DEFCON 1
  • Posts: 1778
  • sudo rm -rf /
    • View Profile
Re: VSIDO Server
« Reply #2 on: July 13, 2013, 07:39:39 PM »
Samba shouldn't need a login manager - smbclient should have command line options like ftp

edit - found this; have never heard of smbtree:

www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0CEgQFjAF&url=http%3A%2F%2Fanswers.oreilly.com%2Ftopic%2F79-how-to-connect-linux-clients-to-samba-workgroups-with-command-line-tools%2F&ei=zZbhUb28JqvB4AO_34HACg&usg=AFQjCNGcMY0o_xkGuyVVWlEUHvBUX3l2ig&bvm=bv.48705608,d.dmg

Thanks PackRat, that link looks very promising, not sure how I havent seen it till now  ::)
I agree with you and am not totally sure what Im missing (yet) but without a login manager smb shares will not start correctly. I disabled lightdm from startup and they dont work. I then enabled lightdm and everything worked just fine..... very odd. I have no doubts that its something Im doing and hopefully the link you shared will point me in the right direction.

Headed to a job but when I get back Ill check it out.
Don't Be A Dick!

PackRat

  • Posts: 2255
    • View Profile
    • PackRat configs on github
Re: VSIDO Server
« Reply #3 on: July 13, 2013, 10:08:23 PM »
If you remove lightdm from startup, can you start the samba server from the command line?

If so, one work around until you figure this out may be to restart samba from rc.local.

Odd bug that samba services would be tied to lightdm.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 4191
    • View Profile
    • VSIDO Community
Re: VSIDO Server
« Reply #4 on: July 14, 2013, 01:30:30 AM »
@lwfitz, thanks mate!  Great to hear that the server is doing great

@PackRat, rc.local is most likely the fix for this, great tip
VSIDO      VSIDO FB     VSIDO Google+   

I dev VSIDO

lwfitz

  • DEFCON 1
  • Posts: 1778
  • sudo rm -rf /
    • View Profile
Re: VSIDO Server
« Reply #5 on: July 14, 2013, 06:29:42 AM »
I wish I had something to mark solved....... You rock PackRat! That fixed everything for me. Tomorrow when I get some time I will add this resolution to my samba how to with a special thanks to packrat.
Don't Be A Dick!

PackRat

  • Posts: 2255
    • View Profile
    • PackRat configs on github
Re: VSIDO Server
« Reply #6 on: July 14, 2013, 03:49:03 PM »
I may have found the issue. lwfitz, what version of VSIDO are you running as the samaba server, the regular version which used the rc init scripts, or the fluxbox+systemd?

If you are using the version with the rc init scripts, I think I have found an issue with VSIDO/SID. I have Debian testing on my desktop and VSIDO on my laptop, both have samba installed (although I use neither as a samba server). On my Debian testing box, there is an init script to start the samba services in /etc/init.d/, on my VSIDO laptop, this script is missing. If that script is missing on your server as well, then your server cannot start the samba services properly - I have no idea why lightdm is creating these shares; but disabling lightdm results in no samba.

My solution for you - attached in code blocks is the init script for samba from my Debian testing machine, copy it to /etc/init.d/ and make the appropriate symlinks to the run levels you use for your samba server.

A handy program to use for this is sysv-rc-conf - it is a command line tool run as root that brings up a handy checkbox matrix of available run levels and services (it is in the repos). Checking a box creates the symlinks in the appropriate run level, unchecking it will disable the service. With sysv-rc-conf, you can quickly activate the samba service and disable the lightdm service for your run level of choice. This should start the samba services properly and allow you to run your server sans window manager.

Obviously, if you are using systemd, or the samba init script does exist on your server, then this post is irrelevant and your back to Square d'Uno.

I am totally stumped why lightdm would start samba services/shares; I know the login managers handle some services - (mounting drives as non-root is the main one) but why samba? Maybe read the /etc/init.d/lightdm file for some samba statement?

Goog luck, amigo.

samba init script, copy to /etc/init.d

Code: [Select]
#!/bin/sh

### BEGIN INIT INFO
# Provides:          samba
# Required-Start:    $network $local_fs $remote_fs
# Required-Stop:     $network $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Should-Start:      slapd cups
# Should-Stop:       slapd cups
# Short-Description: start Samba daemons (nmbd and smbd)
### END INIT INFO


# Defaults
RUN_MODE="daemons"

# Reads config file (will override defaults above)
[ -r /etc/default/samba ] && . /etc/default/samba

PIDDIR=/var/run/samba
NMBDPID=$PIDDIR/nmbd.pid
SMBDPID=$PIDDIR/smbd.pid

# clear conflicting settings from the environment
unset TMPDIR

# See if the daemons are there
test -x /usr/sbin/nmbd -a -x /usr/sbin/smbd || exit 0

. /lib/lsb/init-functions

case "$1" in
start)
log_daemon_msg "Starting Samba daemons"
# Make sure we have our PIDDIR, even if it's on a tmpfs
install -o root -g root -m 755 -d $PIDDIR

if [ -n `which testparm` ]
then
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
fi
if [ "$NMBD_DISABLED" != 'Yes' ]; then
log_progress_msg "nmbd"
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/nmbd -- -D
then
log_end_msg 1
exit 1
fi
fi

log_progress_msg "smbd"
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then
log_end_msg 1
exit 1
fi

log_end_msg 0
;;
stop)
log_daemon_msg "Stopping Samba daemons"
log_progress_msg "nmbd"

start-stop-daemon --stop --quiet --pidfile $NMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $NMBDPID ] && ! ps h `cat $NMBDPID` > /dev/null
then
# Stale PID file (nmbd was succesfully stopped),
# remove it (should be removed by nmbd itself IMHO.)
rm -f $NMBDPID
fi

log_progress_msg "smbd"
start-stop-daemon --stop --quiet --pidfile $SMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
then
# Stale PID file (nmbd was succesfully stopped),
# remove it (should be removed by smbd itself IMHO.)
rm -f $SMBDPID
fi

log_end_msg 0

;;
reload)
log_daemon_msg "Reloading /etc/samba/smb.conf" "smbd only"

start-stop-daemon --stop --quiet --signal HUP --pidfile $SMBDPID

log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
        status)
status="0"
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
if [ "$NMBD_DISABLED" != "Yes" ]; then
status_of_proc -p $NMBDPID /usr/sbin/nmbd nmbd || status=$?
fi
status_of_proc -p $SMBDPID /usr/sbin/smbd smbd || status=$?
exit $status
;;
*)
echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
exit 1
;;
esac

exit 0

If this init script gets your server running, can it be added to future VSIDO releases? Otherwise link/copy it to your HowTo.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

lwfitz

  • DEFCON 1
  • Posts: 1778
  • sudo rm -rf /
    • View Profile
Re: VSIDO Server
« Reply #7 on: July 16, 2013, 08:02:35 AM »
Thanks PackRat, I am running the newest ISO with systemd and fluxbox. Could this be the issue? I do have a couple older images from before systemd was added that I can install from and then update.
Don't Be A Dick!

PackRat

  • Posts: 2255
    • View Profile
    • PackRat configs on github
Re: VSIDO Server
« Reply #8 on: July 16, 2013, 09:55:33 PM »
No, systemd should not be an issue, but the above script is for the systemv init.

You would need to create a systemd script (or whatever they call it) that does the same thing and set it up to run at startup. Not that hard if you have not done it - basically write the script in the proper format and get it in the correct location. The Arch Wiki has some good examples of how that is done.

I still have no idea why network services would be tied to a login manager - that just doesn't make sense.

Your other option would be to use the non-systemd image/version on your server since, I assume, it just sits there providing various services, and use the script I provided if necessary.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

lwfitz

  • DEFCON 1
  • Posts: 1778
  • sudo rm -rf /
    • View Profile
Re: VSIDO Server
« Reply #9 on: July 16, 2013, 10:08:20 PM »
Im right there with you.

Right on. Ill test your script and let you know how it works and if everything is good Ill add it to my samba howto.
Thanks for all the help on this
Don't Be A Dick!