Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Checking your configfile (/etc/syslog-ng/syslog-ng... STUCK
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Fri Oct 28, 2016 8:22 am    Post subject: Checking your configfile (/etc/syslog-ng/syslog-ng... STUCK Reply with quote

Hello

kernel 4.1.15 x86-64
openrc
grub2

System boots up, runs scripts and stucks on [u]Checking your configfile (/etc/syslog-ng/syslog-ng.conf) ...
it didn't move forward by the whole night so I turned it off, disk OK (no errors)
Every start ends up on this message

What can I do?
_________________
cogito ergo sum
Back to top
View user's profile Send private message
DawgG
l33t
l33t


Joined: 17 Sep 2003
Posts: 878

PostPosted: Fri Oct 28, 2016 9:38 am    Post subject: Reply with quote

i suggest you remove syslog-ng from the relevant (default) runlevel (so it does not block the whole system) and check/fix its configfile. if the init-script gets stuck completely
Code:
syslog-ng --help
shows some help.
GOOD LUCK!
_________________
DUMM KLICKT GUT.
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Fri Oct 28, 2016 10:39 am    Post subject: Reply with quote

can I edit a file (which one) from other linux and disable syslog-ng?
_________________
cogito ergo sum
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31546
Location: here

PostPosted: Fri Oct 28, 2016 11:01 am    Post subject: Reply with quote

Oniryczny wrote:
can I edit a file (which one) from other linux and disable syslog-ng?

Yes you can boot from livecd, mounting the necessary filesystems and entering the new environment. At this point you can remove from runlevel syslog-ng.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Fri Oct 28, 2016 11:05 am    Post subject: Reply with quote

I mean... I connect the hard disk to another computer already running linux and I edit a file (disabling syslog-ng)
_________________
cogito ergo sum
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31546
Location: here

PostPosted: Fri Oct 28, 2016 11:38 am    Post subject: Reply with quote

Oniryczny wrote:
I mean... I connect the hard disk to another computer already running linux and I edit a file (disabling syslog-ng)

For edit a file is ok
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Fri Oct 28, 2016 11:49 am    Post subject: Reply with quote

I still want to know which file should I edit?
_________________
cogito ergo sum
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31546
Location: here

PostPosted: Fri Oct 28, 2016 1:43 pm    Post subject: Reply with quote

Oniryczny wrote:
I still want to know which file should I edit?

The configurations files for syslog-ng are /etc/syslog-ng/syslog-ng.conf and /etc/conf.d/syslog-ng.
For remove manually service from runlevel, I think but I'm not sure, you need to remove file (it's a symlink) /etc/runlevels/default/syslog-ng.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Oct 28, 2016 2:26 pm    Post subject: Reply with quote

Oniryczny wrote:
I still want to know which file should I edit?

You probably have an error in /etc/syslog-ng/syslog-ng.conf. I don't know which version of OpenRC you are running. I am deliberately running an earlier version, because some errors will cause later versions to fail. You want to execute "rc-update del sys-log-ng". If you boot your install media and chroot into your installation, you can do this.

Once you can boot, try running "/etc/init.d/syslog-ng start" If there is a configuration error, it should tell you and also will tell you which file and line has the error.
AFAIK, you can try that in your chroot with "/etc/init.d/syslog-ng restart"
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Fri Oct 28, 2016 3:45 pm    Post subject: Reply with quote

I was still asking about something else than chrooting but anyway thank you :)
_________________
cogito ergo sum
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Oct 28, 2016 4:52 pm    Post subject: Reply with quote

chrooting is easier than dismantling your PC and putting the drive in another machine. Once it's in the other machine you have to chroot anyway.

But, if you are dead set on it, remove the hard drive, put it in another machine, mount it, delete the symlink as fedeliallalinea said, then unmount it, shut down the other machine, put your hard drive back, boot up and once it's booted, try to start syslog-ng manually, and as I said, it should give you a message indicating where the error is. If it hangs again, re-emerge syslog-ng.
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Sat Oct 29, 2016 8:51 pm    Post subject: Reply with quote

Okay
I deleted syslog-ng from runlewel (deleting symlink was much easier than chrooting)
System boots up and I can manually start syslog without any error
but adding it back to runlevel hangs again (I don't know what's wrong if it starts manually)
_________________
cogito ergo sum
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sat Oct 29, 2016 10:12 pm    Post subject: Reply with quote

Does rc-update|grep syslog-ng indicate default or some other runlevel? Which version of OpenRC?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31546
Location: here

PostPosted: Sun Oct 30, 2016 7:57 am    Post subject: Reply with quote

Here a similar problem
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Sun Oct 30, 2016 9:20 am    Post subject: Reply with quote

Code:
# eix -I openrc
[I] sys-apps/openrc
     Available versions:  0.17 0.18.4 0.19.1 0.21.7 ~0.22.1 ~0.22.2 **9999 {audit debug ncurses +netifrc newnet pam prefix selinux static-libs tools unicode KERNEL="FreeBSD linux"}
     Installed versions:  0.21.7(21:47:05 19.09.2016)(ncurses netifrc pam static-libs unicode -audit -debug -newnet -prefix -selinux -tools KERNEL="linux -FreeBSD")
     Homepage:            https://github.com/openrc/openrc/
     Description:         OpenRC manages the services, startup and shutdown of a host

#

openrc doesn't exist in any runlevel now, but it was in the default one only...
_________________
cogito ergo sum
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sun Oct 30, 2016 9:30 pm    Post subject: Reply with quote

Oniryczny wrote:
#openrc doesn't exist in any runlevel now, but it was in the default one only...
I don't understand that comment. BTW, are you running FreeBSD or Linux?

Since you are running unstable OpenRC, I would emerge the stable as follows and see if it fixes the problem. Unfortunately, you will have to chroot.
Code:
emerge -a1v =sys-apps/openrc-0.17
If it works then you know the culprit is OpenRC.
This is just a temporary change that will be undone at the next update or emerge. Not guaranteed to even boot, but it's the version I'm running.
Code:
X3 ~ # uname -a
Linux X3 4.8.3-gentoo #1 SMP Sat Oct 22 15:17:25 CDT 2016 x86_64 AMD Athlon(tm) II X3 440 Processor AuthenticAMD GNU/Linux
X3 ~ # equery w openrc
/usr/portage/sys-apps/openrc/openrc-0.17.ebuild
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Mon Oct 31, 2016 8:37 am    Post subject: Reply with quote

I thought openrc-0.21.7 is stable...

I'm running normal gentoo (x86-64) kernel 4.1.15
_________________
cogito ergo sum
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Mon Oct 31, 2016 3:02 pm    Post subject: Reply with quote

Oniryczny wrote:
I thought openrc-0.21.7 is stable...

I'm running normal gentoo (x86-64) kernel 4.1.15

You're right! I need to update portage. Nevertheless, try 0.13 as a test. Something's wacky.
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Fri Nov 25, 2016 6:39 am    Post subject: Reply with quote

Now, there's a new version of openrc (0.22)
But still doesn't work on my machine...
_________________
cogito ergo sum
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Nov 25, 2016 2:04 pm    Post subject: Reply with quote

Stumped.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1791

PostPosted: Fri Nov 25, 2016 7:35 pm    Post subject: Reply with quote

now you mentioned it seems to work when you start syslog manually, but did you verify that it is really working?

This site, gives some good tips on how to troubleshoot syslog https://pzolee.blogs.balabit.com/2009/12/troubleshooting-and-debugging-syslog-ng/

One thing it says, which will be helpful is running
Code:
 syslog-ng -Fevd


This will output a lot of information, to your regular console and make syslog so it runs in the foreground. Another nice about this command is that it will let you know, if system log is receives a message and what it does with it. If it crashes, then obviously this will let you know of that too and help identify if it's a config issue or an issue with syslog it's self...

Quote:
You can also use other useful programs for testing syslog-ng.

To send logs to “/dev/log”, use the logger. This program exists on the most platforms.
For example:

~$ logger “message part”

I don't know if this logger will be available, as I am not on my linux machine right now, but if you do have it; it can send a message to have it logged...
Otherwise, most times syslog will log when a user logs in (i.e. in another console su into root, possibly wrong password, etc...).
I don't have much experience with sudo if those are logged, hence why I don't mention that...

Now from experience, 2 common things can cause syslog throw a fit, is config-version, and use-dns()...

Syslog-ng Documentation wrote:
use-dns()
Type: yes, no, persist_only
Default: yes

Description: Enable or disable DNS usage. The persist_only option attempts to resolve hostnames locally from file (for example from /etc/hosts). The syslog-ng OSE application blocks on DNS queries, so enabling DNS may lead to a Denial of Service attack. To prevent DoS, protect your syslog-ng network endpoint with firewall rules, and make sure that all hosts which may get to syslog-ng are resolvable. This option can be specified globally, and per-source as well. The local setting of the source overrides the global option if available.


Obviously, if it's unable to resolve hostname (because network isn't up to query the DNS server), this is going to make syslog-ng seem like it hangs due to having to wait for the resolver timeout and fail...
So you may want to put this into your config file so it doesn't try resolving hostnames...
Code:
use-dns(no)


I'll leave this up to you to figure out where to put it...
Here's a link to syslog's documentation... https://www.balabit.com/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html-single/index.html
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Sun Nov 27, 2016 5:38 pm    Post subject: Reply with quote

I got something like this http://wklej.org/id/2972472/
_________________
cogito ergo sum
Back to top
View user's profile Send private message
gr3m1in
n00b
n00b


Joined: 22 Mar 2010
Posts: 39
Location: Poland

PostPosted: Fri Nov 01, 2019 11:14 pm    Post subject: Reply with quote

This topic is pretty old, however I've just faced exactly the same problem.
I've googled for the solution with no luck, so I'm writing this.
I think that I found the solution, maybe it will help someone.
Since there is somewhat similar behavior with sddm some time ago, I tried to just press random keys on the keyboard while syslog-ng was in "hanged" state.
It appeared that it helps, so I guessed that syslog-ng now requires an entropy generator as well as sddm did.
Having haveged already installed for sddm, and having it and syslog-ng both at boot runlevel, I just forced haveged to start before syslog-ng with
Code:
rc_syslog_ng_need="haveged"

at /etc/rc.conf.
That worked at once.
I hope it was useful.
Back to top
View user's profile Send private message
Stolz
Moderator
Moderator


Joined: 19 Oct 2003
Posts: 3028
Location: Hong Kong

PostPosted: Thu Nov 07, 2019 11:55 am    Post subject: Reply with quote

I was having the same issue. syslog-ng was frozen during boot waiting for entropy. I had to move the mouse or press keys to unfreeze it. In my case I didn't have to install Haveged, I just enabled one kernel option: CONFIG_RANDOM_TRUST_CPU=y
Back to top
View user's profile Send private message
cbx550f
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2004
Posts: 113
Location: Ontario, Canada

PostPosted: Fri Nov 08, 2019 7:18 am    Post subject: Reply with quote

Stolz wrote:
I was having the same issue. syslog-ng was frozen during boot waiting for entropy. I had to move the mouse or press keys to unfreeze it. In my case I didn't have to install Haveged, I just enabled one kernel option: CONFIG_RANDOM_TRUST_CPU=y


Stolz: I owe you a beer! I had the same issue (originally it was stuck when starting syslog-ng, but after disabling that it was stuck on something else... forgive me for forgetting what that was). Your tip there saved me a ton of bother.

Changed kernel config and all is good! Thanks man!

For reference, under "Device Drivers" in kernel config, I selected "Trust the CPU manufacturer to initialize Linux's CRNG" (4.19 kernel)

Cheers
_________________
I think, therefore I am wrong.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum