run X as spot...audio work successfully! thanks to GuestToo

Using applications, configuring, problems
Post Reply
Message
Author
tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

run X as spot...audio work successfully! thanks to GuestToo

#1 Post by tux_friend »

how to run X as spot? what's the best way to login as spot?
i have open x as spot with jeffrey's tips 8)
Last edited by tux_friend on Sun 03 Sep 2006, 20:41, edited 7 times in total.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

how to run X as spot? what's the best way to login as spot?
why do not create a tutorial?
shut down X
su spot
cd
startx

you will have to setup configuration files in spot's home dir first ... you will have to set up permissions on various files and dirs and devices, for example, you will have to setuid X (in other words, X has to run as root anyway), and startx (xwin) writes to files in /tmp and /etc, these files must be made writable by spot

if you don't setup things first, spot will not be able to mount, unmount, or access drives ... spot will only be able to write to the home dir

there will be no way for spot to install programs ... many of the programs that are installed will not work ... for example, the program's configuration files are in /root, not in spot's home dir

also, many of my programs are in /root, and make symlinks in /usr when the program starts ... i did it this way because at one time, Puppy would simply delete everything that was installed in /usr when Puppy upgraded ... but spot can not create symlinks in /usr, so these programs will not run as spot

it's easy enough to run X as spot, or any user you create ... but don't expect Puppy to work exactly the same as it did before ... a lot of things will be broken

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

thanks

#3 Post by tux_friend »

hi guestToo,thanks for your help.
but...how to setuid X? i'm not know this.... :)

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#4 Post by GuestToo »

you just have to type:

chmod u+s /usr/X11R6/bin/Xorg
chmod u+s /usr/X11R6/bin/Xvesa

and X windows will run as if root was running it.
X needs this to be able to work with the hardware devices

if you already have got X to run as an unprivileged user, like spot, then it probably already has the setuid bit set ... you only have to do it once

once you get X running, you just have to deal with the various permissions problems that will occur ... if you want to make a simple system for your sister to browse the internet, that should not be difficult

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

problem

#5 Post by tux_friend »

hi,i have successfully setuid X.
the wallpaper does not work,...cannot set desktop background...
the sound does not work...the gxine program is not able to open the sound device as spot...
however,this is only little problems....

but,when i reboot my pc,i login as spot but X does not start,is needed to type again:
chown spot /tmp/xerrs.txt /etc/.XLOADED
how to make permanent this? when i have turn on the pc,is needed login as root,open terminal,type chown spot /tmp/xerrs.txt /etc/.XLOADED ,logout,and login as spot.

using spot user,the puppy pc is secure when my sister go to the pc
thanks
:D

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#6 Post by GuestToo »

you could start X from your own script ... normally you would type "startx" to start X windows ... you make a script and call it maybe "startx-as-spot" ... X is started from /etc/profile (the line "exec xwin"), just edit /etc/profile and change it to "exec startx-as-spot"

you could make the script by right clicking in the /root/my-applications/bin directory and clicking New, Script ... you could put something like this in the script:

#!/bin/sh
rm -f /tmp/xerrs.txt
chown spot /etc/.XLOADED
chown spot /tmp/currentvideomode
cd /root/spot
exec su spot -c xwin

or put the script in /usr/X11R6/bin/ if you like

anyway, something like that ... you have to get the details right, and Puppy should boot and start X as user "spot"

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

ok

#7 Post by tux_friend »

thanks for the help...
but,why the sound not work? gxine does not able to open the sound device...
the sound icon not is present in the tray-bar...is present only blinky and the clock
at the moment i use root account to listen songs 8)

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#8 Post by GuestToo »

yes, a lot of stuff will be broken

try typing this as root:

chmod a+r /dev/audio0

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

why y can't set desktop background?

#9 Post by tux_friend »

why y can't set desktop background? X display only a grey screen
hovewer,this is smaller problems...puppy is a linux distro built from scratch.
i have selected puppy because i dont like kde or gnome.
i have adsl flat to download but i dont like big distro (fedora,suse,mandriva).
my philosophy of life: the good wine is in the small glass.
:)

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#10 Post by GuestToo »

the audio should work if you type this as user root:

chmod a+r /dev/audio0
chmod a+rw /dev/mixer

or you could put it in your startx as spot script ... it is not necessary to do it each time, but you can if you want

it depends which version of Puppy you are running ... i am running Puppy 2.10 alpha, and i put this in /root/.xinitrc to set the wallpaper:

qiv -z /usr/share/backgrounds/puppywallpaper1024x768.jpg

just before the line:

exec $CURRENTWM

(i was testing what Puppy 2.10 needs to run X as spot)

what exactly Puppy is doing to set the wallpaper depends on which version of Puppy you are running, and what programs you have installed

and i copied /root/.Xresources to /root/spot and to get bigger fonts, i changed:

Xft.dpi: 84

to

Xft.dpi: 100

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#11 Post by GuestToo »

and to get rxvt to run as spot in Puppy 2.10a, i had to do this:

chmod a+w /dev/ptmx

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#12 Post by GuestToo »

to make the wallpaper setter in Puppy 2.10a work, you have to do this:

chmod a+x /usr/local/Puppybackground/Puppybackgroundmenu /usr/local/Puppybackground/resource/cachemanager /usr/local/Puppybackground/resource/list /usr/local/Puppybackground/resource/Puppybackgroundmenu.pb /usr/local/Puppybackground/resource/puppybackgroundsetterwrapper /usr/local/Puppybackground/resource/resamplefixedheight /usr/local/Puppybackground/resource/roxrestart.sh-deactivated /usr/local/Puppybackground/resource/waitwindowpbdesk.sh

this is all one line

but you will probably not be able to change the wallpaper, it will just be able to show whatever wallpaper was already set by user root

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

thanks for all your help

#13 Post by tux_friend »

hi GuestToo,thanks for all your help...i have my wallpaper selected from root account and i have open terminal as spot.
only the sound does not work...i have puppy 2.01 seamonkey.
...you have another ideas to open the sound as user spot?

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#14 Post by GuestToo »

i do not have 2.0.1 installed ... i am experimenting with 2.10 ... this works in Puppy 2.10:

chmod a+r /dev/audio0
chmod a+rw /dev/mixer

(as root, of course)

maybe you need to allow spot to write to /dev/audio0, like this?

chmod a+rw /dev/audio0

or maybe your audio is using a different device

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#15 Post by GuestToo »

by the way, you can not su to root from a terminal console unless you setuid tinylogin, like this:

chmod u+s /bin/tinylogin

type su to become root ... press the enter key for the password

i don't know how much of a security risk this is

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

Re: run X as spot...audio problem

#16 Post by tux_friend »

hi GuestToo,
my error is:
error opening ALSA device default: Permission denied

i have a ati-ixp onboard sound card.
at the moment the audio work only from root account...
i have tryed all methods.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#17 Post by GuestToo »

here are some lists of audio devices ... if the sound works for root but not for spot, it is probably a permissions problem for one of the sound devices

http://www.tdl.com/~netex/html/Sound-HOWTO-6.html

and here

you may need to copy the configuration files from /root to /root/spot ... for example, .gxine and .xine

actually, if the audio group is setup correctly in Puppy, so you should be able to do this:

chmod g+rw /dev/audio0
chmod g+rw /dev/mixer
chmod g+rw /dev/dsp

which should be a little safer than a+rw

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

Re: run X as spot...audio problem

#18 Post by tux_friend »

hi GuestToo,the audio working,my device is /dev/dsp
i have write: chmod a+r /dev/dsp
at the moment,the spot access is complete :D
thanks for your assistance.
at the moment only small problem is present,at example the browser dillo does not work,but this problems is very very small!

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

complete script

#19 Post by tux_friend »

this is a complete script.

#!/bin/sh
chmod u+s /usr/X11R6/bin/Xorg
chmod u+s /usr/X11R6/bin/Xvesa
chown spot /tmp/xerrs.txt
chown spot /etc/.XLOADED
chown spot /tmp/currentvideomode
chmod g+r /dev/audio0
chmod g+rw /dev/mixer
chmod g+rw /dev/dsp
chmod a+w /dev/ptmx
chmod a+x /usr/local/Puppybackground/Puppybackgroundmenu /usr/local/Puppybackground/resource/cachemanager /usr/local/Puppybackground/resource/list /usr/local/Puppybackground/resource/Puppybackgroundmenu.pb /usr/local/Puppybackground/resource/puppybackgroundsetterwrapper /usr/local/Puppybackground/resource/resamplefixedheight /usr/local/Puppybackground/resource/roxrestart.sh-deactivated /usr/local/Puppybackground/resource/waitwindowpbdesk.sh

bye and thanks

tux_friend
Posts: 23
Joined: Sat 02 Sep 2006, 22:28

correction

#20 Post by tux_friend »

correction: do not use g+rw,because in my pc the sound device does not start...

this is a script corrected

!/bin/sh
chmod u+s /usr/X11R6/bin/Xorg
chmod u+s /usr/X11R6/bin/Xvesa
chown spot /tmp/xerrs.txt
chown spot /etc/.XLOADED
chown spot /tmp/currentvideomode
chmod a+r /dev/audio0
chmod a+rw /dev/mixer
chmod a+rw /dev/dsp
chmod a+w /dev/ptmx
chmod a+x /usr/local/Puppybackground/Puppybackgroundmenu /usr/local/Puppybackground/resource/cachemanager /usr/local/Puppybackground/resource/list /usr/local/Puppybackground/resource/Puppybackgroundmenu.pb /usr/local/Puppybackground/resource/puppybackgroundsetterwrapper /usr/local/Puppybackground/resource/resamplefixedheight /usr/local/Puppybackground/resource/roxrestart.sh-deactivated /usr/local/Puppybackground/resource/waitwindowpbdesk.sh

Post Reply