Spacewalk clients check with the server 

 

Here we will see where is the check file and how often it runs per config 

The check config file is located in this location: "/etc/sysconfig/rhn/osad.conf"

[root@kacd01-acd01-lpm01-app-1584651288 ~]# cat /etc/sysconfig/rhn/osad.conf

#########################################################

[osad]

# don't change this
systemid = /etc/sysconfig/rhn/systemid

# increase for debugging output
debug_level = 0

# don't change this... used in substitutions below.
# if you get rid of the '%(server_handler)s' bits below,
# the *MUST* be replaced with this value...
server_handler = /XMLRPC

# Protocol to talk upstream
proto = https

# to use a server other than what up2date is configured to use,
# do something along the lines of:
# server_url = https://some.example.com%(server_handler)s
# server_url = http://another.example.net:8080%(server_handler)s
# server_url = https://yet.another.example.org:8081/XMLRPC
server_url = %(proto)s://%(server_name)s%(server_handler)s

# the following fields are inherited from up2date's configuration,
# but are overridable in this file

# enableProxy = 1
# enableProxyAuth = 1
# httpProxy = some.proxy.example.com:3030
# proxyUser = proxy_user_name
# proxyPassword = proxy_password

# Use a different certificate from what up2date is using
# This should point to the satellite certificate for
# server_name
# osa_ssl_cert = /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CER
osa_ssl_cert =

logfile = /var/log/osad

max_time_drift = 120

run_rhn_check = 1

# Default command to run when asked by the dispatcher
rhn_check_command = /usr/sbin/rhn_check

# By default we only use the first jabber server.
# Turn the enable_failover option to 1 if you want the connections
# to try Satellite's jabberd if Proxy's is not available.
enable_failover = 0

# Enable kernel keepalive timer on the osad client side socket
# in case the satellite/proxy side socket is closed without osad realising it
# After 'tcp_keepalive_timeout' seconds the kernel will probe the connection
# After 'tcp_keepalive_count' unsuccessful probes, the kernel will close the connection
tcp_keepalive_timeout = 1800
tcp_keepalive_count = 3

#########################################################

 

There is a know bug already filed with Redhat where the the client dopes not check with the server 

Bug 1584255 - rhnsd scheduled rhn_check doesn't work on a targeted/enforcing SELinux system

https://bugzilla.redhat.com/show_bug.cgi?id=1584255

 

** So to work around this we created a client side cronjob that will run this command in the config file 

 

Where is rhn_check running from:

[root@keng03-dev01-hlp15-app-1584975221-1 ~]# grep -rnw '/etc/' -e "rhn_check"

/etc/sysconfig/rhn/clientCaps.d/osad:2:osad.rhn_check(1)=1

/etc/sysconfig/rhn/osad.conf:45:rhn_check_command = /usr/sbin/rhn_check

/etc/selinux/targeted/contexts/files/file_contexts:2296:/usr/sbin/rhn_check-[0-9]+\.[0-9]+      --      system_u:object_r:rpm_exec_t:s0

/etc/selinux/targeted/contexts/files/file_contexts:4534:/usr/sbin/rhn_check     --      system_u:object_r:rpm_exec_t:s0

Binary file /etc/selinux/targeted/contexts/files/file_contexts.bin matches

/etc/selinux/targeted/active/file_contexts:2296:/usr/sbin/rhn_check-[0-9]+\.[0-9]+      --      system_u:object_r:rpm_exec_t:s0

/etc/selinux/targeted/active/file_contexts:4534:/usr/sbin/rhn_check     --      system_u:object_r:rpm_exec_t:s0

 

spacewalk check agent (if client does not check in do a cron job)

rhn_check is:

/usr/sbin/rhn_check

 

this is a cron that will run every 5 minutes and run the "rhn_check" command:

*/5 * * * * /path/to/script-or-program

*/5 * * * * /usr/sbin/rhn_check

 

this is a cron that will run every 15 minutes and run the "rhn_check" command:

*/15 * * * * /usr/sbin/rhn_check

 

this is a cron that will run every hour 1.05, 2.05, 3.05 etc and run the "rhn_check" command:

5 * * * * /usr/sbin/rhn_check