LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 12-18-2011, 12:12 PM   #1
frog-o
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Rep: Reputation: 0
Debugging systemd quirks (hangs switching target etc) (work in progress tutorial)


I been having a lot of problems with trying to git Systemd running and i wanted to write a better tutorial on this and post some of the problem i been having with this. I do plain on adding more to this latter if i can git myself motivated and there seem a reason to do so.

Note to form administrators:
(
if you find this useful please do make it sticky other wise ignore this note.
)

Please be warned

* This tutorial is based on my 1 experience with debugging systemd.

* I am a tinker,Not a systemd developer(I do allot of strange stuff see note at end)

* It may be far from accurate (which is the reason I wrote it in the form instead of the wiki feel free to copy this to there if you check it for accuracy and clean it up enough).


Please help me write and make this tutorial better.

* If you see something not right or think it can be better word better please let me know.
* If you are a systemd developer and happen to come across this please let me now how accurate it is.
* Let me know what is helpful and what is not
* i would realy like to here on the form it it was helpful( I don't have high self ex-steam)

Thank you


The very first step is make a backup boot cd

This is the very first thing before doing anything is to make sure you have a backup boot disk ( or at at the very minimal another Linux partition or install) that you can boot and chroot your file-system from. This is very import if you break systemd completely.


The cause of systemd failure and hags That i had where caused by 3 thing

1.) fstab is not playing nice with systemd add is timing out

2.) dbus service is not running (I had this happen to me becuase dbus was told to run in dbus group and I didn't have a dbus group)

3.) Critical service is not running(I had fscheck.services local-fs.service etc. fail on me because systemd did not liking root on lvm and I had to change there scipt wich I copy and change in /etc/systemd/system)


The Second step you should do Is gather information

You can do this by

1. Add boot parmiter

* systemd.log_level=debug

* systemd.log_target=kmsg

or if don't like to do that you can also change /etc/systemd/system.conf and change it there.

I would also add

* console=tty12

to the kernel command line so output of systemd won't be erased by login prompt when it comes up on kernel boot prompt.


***************************************************************************************
Tip IMHO it is never a good idea to change grub boot perimeters with out making 1 backup copy the

whole menuentry stuff in case you mess something up( this might be just me)

menuentry "linux-arch" {
root=(Group1-home)
linux /boot/vmlinuz-linux --unit=emergency.target console=tty12
initrd /boot/initramfs.igz
}

stuff (my grub 3 modified shown)

If you do mess something up grub dose allow you temporarily modify it on boot provided you know how you messed it up.
***************************************************************************************







2. Looking at the /var/log/ directory

The directory /var/log/ is critical when tring to debug allot of programs put there log files in this directory.

3. change /etc/files

If you notice on the console that a program is hanging allot. Most like there a config file in etc for it. If there is one most often there an option to add more debug info to the console or log file.

4. dmesg

is probably the quickest way two look for problem type dmesg at the console show a lot of problems. This is often use with the | symbol and grep cmd to help you search for specific problems

for example typing

dmesg

will print alot of info about the system two much in fact

so they use grep with no option for a case sensitive search

dmesg | grep error

or they add the i opption for a case insesitive

dmesg |grep -i error

5. systemctl

can give you a lot of info it will tell you what services is runing and if it failed( it look to me It work even thought dbus did not start) I think it because systemd caches stuff until the service is started.

The third step try to start just the most basic services

There are many reason for hangs systemd doc say you should try running

bin/systemd --test --system –log-level=debug

sometime this is not a option because you can't even boot systemd to work around this problem is a good idea to try to just the minamal
service you can do this by creating a symbolic

ln -s /etc/systemd/system/default.target /lib/systemd/system/emergency.target


The forth step start one service at a time

after you git into an emergency.target try start the most important service first. Here are my sugestion

systemctl start syslog.service
systemctl start dbus.service
systemctl start network.target
etc.


Reason for writing:

In sort I thought I could do it better, because I had there doc and can add two it.
I also like tinkering a lot like( put root on lvm, installing linux in a dirctory, etc). Have example add allot of detail I beleve to be very import. IMHO most people don't do it that well because it take a lot of time. I spent what seem like eternity writing this tutorial as bad as it is.

IMHO have poorly written but detail doc is more import than have clean and good written grammar doc that don't give you any details or a clue where to go.

Resources:

http://fedoraproject.org/wiki/How_to...stemd_problems
http://www.freedesktop.org/wiki/Software/systemd
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 10:02 AM
LXer: Some Small Progress On Linux GPU Laptop Switching LXer Syndicated Linux News 0 11-09-2010 07:30 AM
OpenSuse hangs frequently. Need help in debugging. membit Linux - Server 2 02-03-2010 12:09 AM
FC 10: My installation hangs after the first white progress bar guarriman Fedora - Installation 13 02-06-2009 06:44 PM
LXer: Remote cross-target debugging with GDB and GDBserver LXer Syndicated Linux News 0 11-28-2007 04:20 PM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration