Lots of users are moaning about puppy not being multiuser, well me personally don't need that but I was interested to see if I can hack it to do that and maybe learn little more about puppy that way. I'll tell you what I've done so far and how.

WARNING! Do NOT try to do this if you're not sure what you're doing, I'm not responsable for any system failure or data loss you may cause! I recommend making some frugal install or create another pup_save for trying this

OK, so like I said, there's another user in puppy already and it's called spot (that folder spot in your /root dir is spot's home dir. But puppy logs in into root account on every boot automatically. So here's a first step:

Edit your /etc/inittab
edit line which says:
tty1::respawn:/sbin/getty -n -l /bin/autologinroot 38400 tty1
remove -n -l /bin/autologinroot
so now you have left this in that line:
tty1::respawn:/sbin/getty 38400 tty1
Now when you reboot system it will ask you for username and pass
Default pass for root is woofwoof

OK, so now we have two users with passwords and login prompt at bootup

But, we're not nearly finished. Most of scripts for running X read info and stuff from root's home dir so what do I do next?

Copy all files from root's dir (except spot dir itself, including hidden dirs) into spot dir, then I change owner of those files to spot:

Code:

chown -R spot /root/spot

Next: hack xwin to load xinitrc from user's home dir instead from root's
Open /usr/X11/bin/xwin then replace where it says /root/.xinitrc to ~/.xinitrc (use Search -> Replace -> Replace All in Document in Geany)

Also X starts apps and scripts from /root/Startup and I don't know where is the script that loads them, so I make a workaround for that:
Make directories /root/XStartup and /root/spot/XStartup then place a script in /root/Startup to start apps from that dirs at X startup:

Code:

#!/bin/sh
cd ~/XStartup/
for i in *; do ./$i; done

^Place this script in /root/Startup and all other startup scripts place in /root/XStartup and /root/spot/XStartup

OK, so what you will be able to do with this changes so far using spot as user?
You'll be able to start X, run most of apps and have some settings customized?
What you won't be able to do?
You can't mount anything, and you can't start console (it keeps dissapearing, I thought this is because of rxvt's hold option, but sakura and xterm didn't work either, maybe we could throw in sudo command or something?)

Here are some more issues that I noticed:
--Files /tmp/xerrs.log | /etc/.XLOADED | /etc/windowmanger | /dev/zero
have read-only permissions for spot (maybe chmod here?)
--If you change icons they will be changed on both accounts
--You can't change wallpaper as spot, setter writes changes to root's PuppyPin file?

You can change icewm theme though

OK, enough from me, please test this and find out some more hacks we can do.

The deskop icons are part of Rox, which is started in ~/.xinitrc. Tell it to use ~/Choices/ROX-Filer/PuppyPin rather than /root/Choices/ROX-Filer/PuppyPin.

I found that same terminal bug a number of months ago when I was doing a crude kid-safe setup. I think the problem was a file in /dev. I'll go see if I can find where I posted about it before so you can fix that.

If you're intending to take this all the way, you'll want to do some quick studying on "grep". (If you aren't that serious about this, no worries - I am, and intend to start working on a proper setup this summer. Any help is welcome - and you're VERY welcome to save me a lot of time and finish before I get started ) Grep lets you find text within files. For example, to find the /root/Startup code, I had only to run this command:

Code:

grep -R '/root/Startup' /usr/sbin /etc/

The -R tells it to be recursive. The '/root/Startup' is the string it searches for. The /usr/sbin and /etc are directories I want it to look through. I could have given it /, but then it would have searched everything in /mnt, which is quite a lot. Even searching all of /usr can be slow. So I try to narrow it down to places I think are likely first, and widen the search as needed until I find it.

I could also have added the -l flag (that's a lowercase L) to have it only output the filenames that have the text, instead of the filename and the text. That's useful if there are many matches within a single file, because it would stop it from spamming your terminal.

Use grep --help for more info.

Sed is also handy, but you have to be careful with it. It lets you find-and-replace text from a script. You could theoretically do this:

Code:

sed -i 's|/root/|~/|g' /some/file/name

to replace all instances of /root/ with ~/ in a the file /some/file/name. You could combine it with a find command like this:

Code:

find / -mount -type f -exec sed -i 's|/root/|~/|g' "{}" \;

To replace every instance of /root/ with ~/ throughout the drive (it won't look at mounted filesystems). But that could be dangerous. Some things might actually need to use /root/ specifically. And, it wouldn't only affect scripts - it would affect any file with that text in it, binary files included. You'd probably want to somehow filter out the non-text files. All in all, it would be best to look at each file manually to make sure they're all safe to change.

Also, I have a vague memory that in some cases, it may be better to use $HOME/ rather than ~/. I think it was because the ~/ isn't as portable across different shells?_________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Tell it to use ~/Choices/ROX-Filer/PuppyPin rather than /root/Choices/ROX-Filer/PuppyPin.

I did, forgot to mention that, that saves icons and their positions, but not icon theme! I think actuall icons are copied from their theme directories into /usr/local/lib/X11/pixmaps/ and rox's PuppyPin saves only icons names that pinboard loads from that dir, so if current icons theme is "Stardust" all icons from /usr/local/lib/X11/themes/Stardust will be copied in /usr/local/lib/X11/pixmaps

And for terminal, it might be this /dev/zero permission cause it says it cannot open it when starting X?

Also we need to hack scripts for changing themes, and also see if /etc/windowmanager is also called from xinitrc and maybe put that to save selected wm into ~/.etc/windowmanager ?

I'm familiar a bit with all those commands, just couple a days a go found good tutorial for sed, I don't know if I'll push this 'till the end, but I'm glad we can help each other. _________________Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works

Also, I have a vague memory that in some cases, it may be better to use $HOME/ rather than ~/. I think it was because the ~/ isn't as portable across different shells?

Well, I noticed this variable when looking at wallpaper script, but for some reason it still loads wallpaper from root's settings (maybe it saves to PuppyPin but reads from /root's PuppyPin when refreshing desktop? Or it's some kind of permission problem too..._________________Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works

Hey, I have another question u might know. /etc/passwd saves info about user accounts, but does it saves passwords in same file? If I did remaster I'd have to know that cause /etc will be in a pristine state._________________Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works

Passwords typically go into /etc/shadow. Group info in /etc/group. User info in /etc/passwd.

Passwords were originally in passwd, but that file is world readable (and needs to be, from what I understand), so they were eventually moved into a separate file that could be made readable only by root (thus the name 'shadow').

I found the thing with the terminal. I haven't re-tested it to verify, but it looks like the problem was the permissions on /dev/ptmx

Code:

addgroup spot tty
chgrp tty /dev/ptmx
chmod g+w /dev/ptmx

That adds "spot" to the tty group, and sets /dev/ptmx to belong to the tty group. It also sets it group-writable. So any user in the tty group can access it. (IIRC /dev/ptmx is a psuedo tty, and used by terminal emulators (a real tty is used by the actual commandline)).

Not sure whether that's the best way to do it. Much better than making it globally writable at least.

Good night._________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Hey, I have another question u might know. /etc/passwd saves info about user accounts, but does it saves passwords in same file? If I did remaster I'd have to know that cause /etc will be in a pristine state.

OK, I'm typing this from spot's account, did manage to fix console with Pizzasgoods tip, also added /dev/zero to tty group. When I type su in console it says :
must be suid to work properly
I tried su root and su -p but no effect, so if you start console you won't be able to do any root stuff like mounting devices and similar. Tried wallpaper setter again, it did change selected image at first, but when it started syncing wallpaper with pwidgets it returned to previous image, so it must be something within that pwidgets sync script._________________Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works

However, in Puppy 'su' is just a symlink to /bin/busybox, which handles a bunch of other basic commands. So setting the setuid bit on su would set it for all of those basic programs. I don't know if that's bad or not._________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

OK, suid worked, but remember how we added those /dev/ptmx and /dev/zero to tty group and made them group writable? I think it didn't remember those settings, when I logged in rxvt disappeared again so I had to do it again? _________________Dpup 487 | Puppy Gallery | My photo gallery | mtPaint works

It didn't remember them across boots, or it didn't remember them across remasters? The remaster script might not include changes you make to /dev, so you'd have to manually correct them at the part where the script pauses and lets you manually adjust things in /tmp before it finishes building._________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum