multiple problems: only root can run X windows; also the setlevel options aren't on the menu

3.7.10-1.1-desktop
Suse 12.3
64 bit intel

I’ve been a bad boy and have been using my root account by default for a long time rather than a user account. Yes, I know you shouldn’t do that.

Relevance?

I loaded Chrome which must be run from a user account. When I logged into my user account, I found the startx command wasn’t working. I had set the initial (default) run level to 3 because I was installing a lot of software that could just as easily be done without graphics. No big deal really because you can always just enter startx.

When I log into a user account, I can’t execute startx. There is a complaint about Xauthorization. I created a new user account as a test and can’t run Xwindows there either.

I thought perhaps I could get around this by running yast then going to “system services (runlevel)”. However when I go into expert mode, there is nothing to pull down from the menu for default run level after boot.

Using startx isn’t really supported anymore.
You can start a display manager with:

systemctl start xdm

I thought perhaps I could get around this by running yast then going to “system services (runlevel)”. However when I go into expert mode, there is nothing to pull down from the menu for default run level after boot.

YaST’s runlevel selection only works when you have a /etc/inittab, which isn’t normally used on 12.3 anymore. You could copy one over from a 12.2 installation f.e.
But you can also set the default target by changing the symlink /etc/systemd/system/default.target accordingly.
In your case you would have to run:

sudo ln -sf /usr/lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

See also: freedesktop.org - Software/systemd/FrequentlyAskedQuestions

On 04/29/2013 06:56 AM, gariac wrote:
> I’ve been a bad boy and have been using my root account by default for
> a long time rather than a user account. Yes, I know you shouldn’t do
> that.

there is no way to know how many different file’s permissions have
been damaged…or which configs are now toast…

couple that with the infusion of systemd into 12.3 and you have a
cocktail of confusion–i wouldn’t know where to begin to ‘fix’ your
system…

especially from a distance, via a forum…

on the other hand, if it were my machine here is what i would do
[read the caveat in my sig prior to following any of this]:

-copy all important data (music, games, emails, photos, movies,
addresses, documents, etc etc etc) to an off_machine medium which
has not been corrupted by misusing root

-format all partitions previously touched by a root powered desktop
environment

-fresh install 12.3 from an iso which passes the md5 or sha1 test and
an install medium which successfully self tests

-decide to never log into any desktop environment as root again

-rebuild the system, install the software, rejoin the data

-live long and prosper

ymmv, so wait and see if another can provide a shorter route to a smile.


dd
http://tinyurl.com/DD-Caveat

Well this did the trick.

ln -sf /usr/lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

In fact, it appears to solved a different problem that I was going to work on. When I booted the system, sometimes it would lockup. Now the lockup issue is gone.

I have another system to update, but it doesn’t have much “usr” software on it. Rather than do an upgrade, does a new installation wipe out the old system partition while maintaining the user partition? That is, I have no custom software to save on that box.

If your system is set to start in runlevel 5, this link should be created automatically during the upgrade. In fact, if you’re already using systemd this link should already exist anyway. If the system is set to start in runlevel 3 I’d suggest you change that in YaST->System Services to runlevel 5 before you do the upgrade. (Because the upgrade would rename /etc/inittab to /etc/inittab.rpmsave, so the runlevel selection in YaST->System Services would not work anymore after the upgrade. If you rename this back to /etc/inittab, the runlevel selection will work again.)

If you’re doing a fresh installation the default would be runlevel 5 (or “graphical.target” to be exact) anyway. And yes, the old system partition would be wiped out. That’s the definition of a fresh installation… :wink:

So you could do it either way…

On 04/29/2013 08:56 AM, gariac wrote:
> I have another system to update, but it doesn’t have much “usr”
> software on it. Rather than do an upgrade, does a new installation wipe
> out the old system partition while maintaining the user partition? That
> is, I have no custom software to save on that box.

you write above in a way i don’t understand…

what do you mean by “usr software” and “user partition”

if by “user partition” you mean /home, then it is possible during an
install (not an upgrade, but an install) to retain the /home
partition (if your /home is in a separate partition) and
format-install the operating system in the “root partition” (/)

but since i do not understand your use of “usr software” i guess i
need to warn that in an install like above, the /usr directory will
be formatted…

this may be interesting:
http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html

finally, if you have also abused the second machine by “using my root
account by default for a long time rather than a user account” then i
would advise that it’s /home NOT be retained into the new
system…instead, save the data to an off machine location and . . .

the bottom line: when one saves those few seconds it takes to give
the root password by doing everything as root . . .


dd
http://tinyurl.com/DD-Caveat

On 2013-04-29 06:56, gariac wrote:

> When I log into a user account, I can’t execute startx.

Of course you can, but you have to allow it. You have to make a change
in “/etc/permissions.local”, and the change is documented there.
However, not everything will work as expected (neither as user or as
root). This is known and there are threads here that explain the
workarounds.

The easy way is just to run “init 5”.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On 2013-04-29 08:56, gariac wrote:
> I have another system to update, but it doesn’t have much “usr”
> software on it. Rather than do an upgrade, does a new installation wipe
> out the old system partition while maintaining the user partition? That
> is, I have no custom software to save on that box.

What is «“usr” software»?

If it is the /usr partition, of course it will be formatted and contents
destroyed. If you mean /home, that is kept.

Besides that, a new installation can keep the entire partition structure
as is (structure, not contents). You just tell the installation to read
the old fstab file.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Note that if you run as root per normal ( A thing that makes me shudder) Any data you have ie emails documents etc are in the /root directory not in /home so a fresh install and not formatting the home partition the root directory will still get zapped because /root is on the root partition and is the home of the root user. So you need to back anything up that you want to keep that may have been stored in /root…

And don’t run in a GUI as root ever ever again lol

Yeah, I meant /home. It was late. So to be clear here, a new installation does not alter /home. Since opensuse has allowed upgrades for some time now, I forgot exactly how it was done prior to that feature. Come to think of it, I can do an upgrade from the DVD, and if things are a bit funky, then try the fresh installation.

I will reform my evil ways and go back to the user accounts. * The other PC in question hasn’t been used for any development, so it has always been run from the user accounts. Looking back on why I was running from root,I think it had to do with firefox not having permission to write to /usr/local/src, and thus the annoyance of having to move and chown the files. In fact I just tried to load into /usr/local/src from a user account rather than root and I got permission denied with Konqueror and firefox just stalled. With git, you can just open a terminal, su, then clone to load into /usr/local/src, but with a browser download, I don’t see a simple solution other than to download to the account in /home then move and chown the files.

Yes, I had init 3 as the default when I did the upgrade, Of course, who knew that would be a problem?*

A new install by default formats home you have to tell the installer not to format home

On 2013-04-30 03:26, gariac wrote:
> Yes, I had init 3 as the default when I did the upgrade, Of course, who
> knew that would be a problem?

I pointed out that you can startx as user just fine. I do. You just have
to allow it, and it is documented.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)