Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Configure OpenRC service to log
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
oreo
n00b
n00b


Joined: 14 Aug 2018
Posts: 31

PostPosted: Sun Aug 19, 2018 12:23 am    Post subject: [solved] Configure OpenRC service to log Reply with quote

How do I configure a service (NetworkManager) to log? To my knowledge there aren't any settings for logging built into NetworkManager, and I think it uses stdout. Also, I here it logs fine on systemd so, there must be a way? There is not any logging information on OpenRC's init script writing page. (https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/Initscripts#Writing_initscripts) I'm trying to debug Network Manager but it is a little more difficult without logs... :D I'll be able to figure out the issues on my own, I just need to get logs. Also I may be on the wrong trail here. Could a logging daemon help here?

Help?

-oreo
_________________
"One does not simply, install gentoo."


Last edited by oreo on Sun Aug 19, 2018 6:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Sun Aug 19, 2018 12:15 pm    Post subject: Reply with quote

It is a good question that you ask, which I can attest that Network Manager does in fact produce a fairly good amount of output that will be caught by any system logging application probably whatever it is.

But in case you need that added reassurance, here is what I have on my system...

Code:
playboy /var/log # emerge -pv sysklogd

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-admin/sysklogd-1.5.1-r1::gentoo  USE="-logrotate" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 3 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.




So that shows that sysklogd is installed, without the logrotate flag (since I typically will just manage the files in the folder of /var myself most of the time) Once installed, the service is activated with rc-service and you should be able to see it running with rc-status:

Code:
playboy /var/log # rc-status
Runlevel: default
 sysklogd                                                          [  started  ]
 NetworkManager                                                    [  started  ]
 vsftpd                                                            [  started  ]


My installation of NM:
Thu Jul 12 22:21:52 2018 >>> net-misc/networkmanager-1.10.10

Some output from daemon.log
Nov 18 09:07:27 playboy NetworkManager[1691]: <info> [1510996047.1384] dhcp4 (wlp4s0): address 192.168.1.6
Nov 18 09:07:27 playboy NetworkManager[1691]: <info> [1510996047.1385] dhcp4 (wlp4s0): plen 24 (255.255.255.0)
Nov 18 09:07:27 playboy NetworkManager[1691]: <info> [1510996047.1385] dhcp4 (wlp4s0): gateway 192.168.1.1
Nov 18 09:07:27 playboy NetworkManager[1691]: <info> [1510996047.1385] dhcp4 (wlp4s0): lease time 86400
Nov 18 09:07:27 playboy NetworkManager[1691]: <info> [1510996047.1386] dhcp4 (wlp4s0): nameserver '192.168.1.1'
Nov 18 09:07:27 playboy NetworkManager[1691]: <info> [1510996047.1386] dhcp4 (wlp4s0): state changed bound -> bound
Nov 18 09:07:27 playboy dbus[1659]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
Nov 18 09:07:27 playboy dhclient: bound to 192.168.1.6 -- renewal in 34209 seconds.
Nov 18 09:07:27 playboy dbus[1659]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Nov 18 09:07:27 playboy nm-dispatcher: req:1 'dhcp4-change' [wlp4s0]: new request (1 scripts)
Nov 18 09:07:27 playboy nm-dispatcher: req:1 'dhcp4-change' [wlp4s0]: start running ordered scripts...


et cetera et cetera

I hope this helps! The good news is that you are on the right track and reading up about logging either in the wiki/Security handbook or elsewhere is a must do for just the kind of situation you have described in diagnosing some issues yourself maybe before turning to the forum again or elsewhere with some added details about the situation.

If you haven't already read the portion of the handbook dealing with logging that would help. https://wiki.gentoo.org/wiki/Security_Handbook/Logging

Most logger applications in linux will capture much of the same stuff but just reorganizes it based on some set of rules you set up. You can decide if what you want is simple or more complex and then play with the log levels either for the different facilities or at the settings for an application as well. For example, if you were setting up an email server and wanted to heighten security checks for passwords or something that would be an easy thing to do with some of these available logging software applications.
Back to top
View user's profile Send private message
oreo
n00b
n00b


Joined: 14 Aug 2018
Posts: 31

PostPosted: Sun Aug 19, 2018 6:28 pm    Post subject: Reply with quote

Thank you for your response! I really appreciate people taking the time to answer my questions! :D

I found the logs under deamon.log. I guess it puts all service logs in there. I'll look into separating them.

For the very slim chance that someone else is having a similar problem and is also reading this thread:

Network Manager starts its own instance of wpa_supplicant and cannot coexist with any other instances of wpa_supplicant. By removing the wpa_supplicant service from the default run level, (via "rc-update del wpa_supplicant" on openrc) the problem is fixed. *face palm*

-oreo
_________________
"One does not simply, install gentoo."
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri Aug 24, 2018 3:42 pm    Post subject: Reply with quote

Glad you got it solved.

You might not be aware of dhcpcd, which also manages wpa_supplicant, and routes traffic; so you can use either or both of ethernet and wireless, and connections do not get dropped.

It's much lighter-weight than network-manager, and just as effective afaics; it's also very well coded and maintained, by the author of openrc.
Back to top
View user's profile Send private message
oreo
n00b
n00b


Joined: 14 Aug 2018
Posts: 31

PostPosted: Sat Aug 25, 2018 5:25 am    Post subject: Reply with quote

The only reason I am using network manager is because wpa_gui sucks. Does dhcpcd have a decent GUI because that is a dealbreaker for me. Also, I don’t really ever use Ethernet so the only reason to switch would be efficiency which is important to me. (I’m trying to figure a way to cut down on resources for an extremely old laptop.)

You don’t really have to answer those questions lol. I’ll find the answers myself. I really appreciate your help and recommendations! :-)

-oreo
_________________
"One does not simply, install gentoo."
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sat Aug 25, 2018 12:18 pm    Post subject: Reply with quote

oreo wrote:
The only reason I am using network manager is because wpa_gui sucks.

Well, it is all relative to what you want. To me personally, wpa_gui sucks less than networkmanager.

oreo wrote:
Does dhcpcd have a decent GUI because that is a dealbreaker for me.

Indeed, there is net-misc/dhcpcd-ui.

oreo wrote:
Also, I don’t really ever use Ethernet so the only reason to switch would be efficiency which is important to me. (I’m trying to figure a way to cut down on resources for an extremely old laptop.)

I'm in the same boat. Most of my kit are old laptops. I have ended up with dhcpcd (and wpa_gui when needed) as the most efficient combination for low resources.
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri Aug 31, 2018 2:26 pm    Post subject: Reply with quote

Just to point out that wpa_supplicant should be started as a service (dhcpcd used to manage that itself.) The linked thread has more info.

Also, if you have any further questions, or need help, then just ask in the dhcpcd thread; UberLord is Roy Marples, the author of both dhcpcd and openrc.
So you're getting the best support you can: direct from the guy who codes it, and admins who've been using it for years.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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