Fix "Can't check kernel version" warning message
On Ubuntu only by default.
This commit is contained in:
		
							parent
							
								
									56ddaab1fd
								
							
						
					
					
						commit
						202ada89cd
					
				| 
						 | 
					@ -1,3 +1,10 @@
 | 
				
			||||||
 | 
					## v2.3.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Enhancements
 | 
				
			||||||
 | 
					* Add variable/template to fix **kern**'s probe related message on Ubuntu
 | 
				
			||||||
 | 
					  (`Can't check kernel version!`)
 | 
				
			||||||
 | 
					    * See : https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725/comments/35
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## v2.2.0
 | 
					## v2.2.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Enhancements
 | 
					### Enhancements
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -79,6 +79,13 @@ xymon_cli__plug_kern_path: '/etc/xymon/clientlaunch.d/kern.cfg'
 | 
				
			||||||
xymon_cli__plug_kern_tpl: 'etc/xymon/clientlaunch.d/kern.cfg.j2'
 | 
					xymon_cli__plug_kern_tpl: 'etc/xymon/clientlaunch.d/kern.cfg.j2'
 | 
				
			||||||
xymon_cli__plug_kern_interval: '5m'
 | 
					xymon_cli__plug_kern_interval: '5m'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Related to "Ubuntu - Can't check kernel version" warning message
 | 
				
			||||||
 | 
					### See : https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725/comments/35
 | 
				
			||||||
 | 
					xymon_cli__plug_kern_fix: '{{ True if (ansible_distribution == "Ubuntu")
 | 
				
			||||||
 | 
					                                   else False }}'
 | 
				
			||||||
 | 
					xymon_cli__plug_kern_fix_path: '/etc/kernel/postinst.d/statoverride'
 | 
				
			||||||
 | 
					xymon_cli__plug_kern_fix_tpl: 'etc/kernel/postinst.d/statoverride.j2'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                                                   # ]]]
 | 
					                                                                   # ]]]
 | 
				
			||||||
## Plugin libs [[[
 | 
					## Plugin libs [[[
 | 
				
			||||||
xymon_cli__plug_libs_state: true
 | 
					xymon_cli__plug_libs_state: true
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,6 +97,19 @@
 | 
				
			||||||
         xymon_cli__plug_manage|bool)
 | 
					         xymon_cli__plug_manage|bool)
 | 
				
			||||||
  notify: restart xymon-client service
 | 
					  notify: restart xymon-client service
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Manage kern plugin [[[1
 | 
				
			||||||
 | 
					- name: PLUGIN kern workaround
 | 
				
			||||||
 | 
					  ansible.builtin.template:
 | 
				
			||||||
 | 
					    src: '{{ xymon_cli__plug_kern_fix_tpl }}'
 | 
				
			||||||
 | 
					    dest: '{{ xymon_cli__plug_kern_fix_path }}'
 | 
				
			||||||
 | 
					    owner: root
 | 
				
			||||||
 | 
					    group: root
 | 
				
			||||||
 | 
					    mode: 0754
 | 
				
			||||||
 | 
					  when: (xymon_cli__manage|bool and
 | 
				
			||||||
 | 
					         xymon_cli__plug_manage|bool and
 | 
				
			||||||
 | 
					         xymon_cli__plug_kern_fix|bool)
 | 
				
			||||||
 | 
					  notify: restart xymon-client service
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Manage net plugin [[[1
 | 
					# Manage net plugin [[[1
 | 
				
			||||||
- name: PLUGIN net config template
 | 
					- name: PLUGIN net config template
 | 
				
			||||||
  ansible.builtin.template:
 | 
					  ansible.builtin.template:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,18 @@
 | 
				
			||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{# Use | comment to manage multilines #}
 | 
				
			||||||
 | 
					# {{ ansible_managed | comment }}
 | 
				
			||||||
 | 
					# Ansible template : {{ template_path }}
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Allow to fix the warning :
 | 
				
			||||||
 | 
					#   "Kernel image /boot/vmlinuz… unreadable. Can't check kernel version!"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725
 | 
				
			||||||
 | 
					# See comment #34 - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725/comments/34
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set -e
 | 
				
			||||||
 | 
					version="$1"
 | 
				
			||||||
 | 
					if [ -z "$version" ]; then
 | 
				
			||||||
 | 
						exit 0
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					exec dpkg-statoverride --force-statoverride-add --update --add root root 0644 "/boot/vmlinuz-${version}"
 | 
				
			||||||
		Loading…
	
		Reference in New Issue