Merge pull request #107 from saveriomiroddi/log_running_processes
Add running processes to logs
This commit is contained in:
commit
36c85cedc1
@ -53,6 +53,7 @@ c_passphrase_named_pipe=$(dirname "$(mktemp)")/zfs-installer.pp.fifo
|
|||||||
c_log_dir=$(dirname "$(mktemp)")/zfs-installer
|
c_log_dir=$(dirname "$(mktemp)")/zfs-installer
|
||||||
c_install_log=$c_log_dir/install.log
|
c_install_log=$c_log_dir/install.log
|
||||||
c_os_information_log=$c_log_dir/os_information.log
|
c_os_information_log=$c_log_dir/os_information.log
|
||||||
|
c_running_processes_log=$c_log_dir/running_processes.log
|
||||||
c_disks_log=$c_log_dir/disks.log
|
c_disks_log=$c_log_dir/disks.log
|
||||||
c_zfs_module_version_log=$c_log_dir/updated_module_versions.log
|
c_zfs_module_version_log=$c_log_dir/updated_module_versions.log
|
||||||
|
|
||||||
@ -214,6 +215,7 @@ function store_os_distro_information {
|
|||||||
|
|
||||||
# Madness, in order not to force the user to invoke "sudo -E".
|
# Madness, in order not to force the user to invoke "sudo -E".
|
||||||
# Assumes that the user runs exactly `sudo bash`; it's not a (current) concern if the user runs off specification.
|
# Assumes that the user runs exactly `sudo bash`; it's not a (current) concern if the user runs off specification.
|
||||||
|
# Not found when running via SSH - inspect the processes for finding this information.
|
||||||
#
|
#
|
||||||
perl -lne 'BEGIN { $/ = "\0" } print if /^XDG_CURRENT_DESKTOP=/' /proc/"$PPID"/environ >> "$c_os_information_log"
|
perl -lne 'BEGIN { $/ = "\0" } print if /^XDG_CURRENT_DESKTOP=/' /proc/"$PPID"/environ >> "$c_os_information_log"
|
||||||
}
|
}
|
||||||
@ -224,6 +226,13 @@ function store_os_distro_information_Debian {
|
|||||||
echo "DEBIAN_VERSION=$(cat /etc/debian_version)" >> "$c_os_information_log"
|
echo "DEBIAN_VERSION=$(cat /etc/debian_version)" >> "$c_os_information_log"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Simplest and most solid way to gather the desktop environment (!).
|
||||||
|
# See note in store_os_distro_information().
|
||||||
|
#
|
||||||
|
function store_running_processes {
|
||||||
|
ps ax --forest > "$c_running_processes_log"
|
||||||
|
}
|
||||||
|
|
||||||
function check_prerequisites {
|
function check_prerequisites {
|
||||||
print_step_info_header
|
print_step_info_header
|
||||||
|
|
||||||
@ -1281,6 +1290,7 @@ fi
|
|||||||
activate_debug
|
activate_debug
|
||||||
set_distribution_data
|
set_distribution_data
|
||||||
distro_dependent_invoke "store_os_distro_information"
|
distro_dependent_invoke "store_os_distro_information"
|
||||||
|
store_running_processes
|
||||||
check_prerequisites
|
check_prerequisites
|
||||||
display_intro_banner
|
display_intro_banner
|
||||||
find_suitable_disks
|
find_suitable_disks
|
||||||
|
Loading…
Reference in New Issue
Block a user