DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-08-02 03:12:00

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

New Group and User Disappears On Reboot

I've been tinkering with the install of NUT. During installation a group and user are created as follows;

groupadd nut

adduser -s /bin/false -G nut -H -D ups

After issuing these commands the I see the group and user have been added to the /etc/group and /etc/passwd files. Upon reboot the group and user disappear. Why is this happening?


Bob Blackwell
Pickering, ON

Offline

 

#2 2008-08-02 04:38:17

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: New Group and User Disappears On Reboot

Because all the /etc/* information is stored on a RAM Drive.  The RAM drive is erased as soon as the unit is powered off.  If yu want the information to stick, you need to write it to flash.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#3 2008-08-02 05:43:18

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: New Group and User Disappears On Reboot

bq041 wrote:

Because all the /etc/* information is stored on a RAM Drive.  The RAM drive is erased as soon as the unit is powered off.  If yu want the information to stick, you need to write it to flash.

I new it was something simple!

Just to make sure I don't screw things up please confirm that would be done using the store-passwd.sh script?


Bob Blackwell
Pickering, ON

Offline

 

#4 2008-08-02 09:10:36

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: New Group and User Disappears On Reboot

Another way to get persistent user and groups is to use a script (executed at boot up) to
over write the /etc/passwd and /etc/goups files with your customized versions of these
files stored on the hard disk (/mnt/HD_a2/<some_dir>)

Since this method does not write to flash, there is very little risk to "screw things up"


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#5 2008-08-03 01:55:54

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: New Group and User Disappears On Reboot

I actually use mig's thoughts to set-up custom samba shares for USB devices.  I just put the script in /ffp/start directory.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#6 2008-08-03 02:43:11

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: New Group and User Disappears On Reboot

bq041 wrote:

I actually use mig's thoughts to set-up custom samba shares for USB devices.  I just put the script in /ffp/start directory.

I've thought this through and believe this would be the best approach.

Thanks gents.


Bob Blackwell
Pickering, ON

Offline

 

#7 2008-08-05 02:08:58

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: New Group and User Disappears On Reboot

You might as well install fonz samba daemon. I installed mine to the USB disk and put my config file there too. Of course I can't configure it through the web interface now but the web interface doesn't support all the settings that I want anyway. wink
You would have to kill the standard samba before starting fonz daemon of course. The easiest way to do that is probably with the samba start script. I adjusted mine like this:

Code:

samba_start()
{
    killall nmbd
    killall smbd
    sleep 5
    proc_start /ffp/sbin/smbd
#    proc_start /ffp/sbin/nmbd
}

If you wonder what the hash sign in front of nmbd is for - I just don't want nmbd to run because I don't need netbios name resolution. I have a DNS server here who does the job.
Just add samba users with the "smbpasswd" command. It will write the password file to "/ffp/etc/samba/private/smbpasswd".

Offline

 

#8 2008-08-09 03:04:09

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: New Group and User Disappears On Reboot

silversurfer wrote:

You might as well install fonz samba daemon. I installed mine to the USB disk and put my config file there too.

silversurfer

Thank you for this tid-bit of information. I've installed the latest Samba package and started browsing the comprehensive manual which should make implementation easier. I don't want to break the USB Drive fun_plug or print queue install thus some in depth reading shall be undertaken by this Linux newbie before activating this service.

A question of curiousity:

If I add the "killall nmbd", "killall smbd" and "sleep 5" to the samba_start() routine then my simple mind tells me I should add "sleep 5", "smb restart" to the samba_stop() routine. Assuming of course I'd like to run the DNS' default samba.

Last edited by rcblackwell (2008-08-09 03:10:12)


Bob Blackwell
Pickering, ON

Offline

 

#9 2008-08-17 14:18:09

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: New Group and User Disappears On Reboot

Actually I think that there is no need to add "smb restart" to the samba_stop() routine. Issuing a "smb restart" in the command line will stop the custom smbd and nmbd and then start the standard smbd and nmbd.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB