Functions | |
| static void | init_tmp () |
| int | exec_sync (string cmd, out string? std_out=null, out string? std_err=null) |
| int | exec_script_sync (string script, out string? std_out=null, out string? std_err=null, bool supress_errors=false, bool run_as_admin=false, bool cleanup_tmp=true, bool print_to_terminal=false) |
| int | exec_script_async (string script) |
| static int | exec_user_async (string command) |
| string? | save_bash_script_temp (string commands, string? script_path=null, bool force_locale=true, bool supress_errors=false) |
| string | get_temp_file_path () |
| static bool | cmd_exists (string cmd_tool) |
| string | get_process_exe_name (long pid=-1) |
| Pid | get_process_parent (Pid process=-1) |
| int | get_euid_of_process (Pid process) |
| Pid | get_user_process () |
| string?[] | get_process_env (Pid pid) |
| string? | get_env (string[] env, string name, string? default_value=null) |
| Pid[] | get_process_children (Pid parent_pid) |
| void | process_quit (Pid process_pid, bool killChildren=true) |
| void | process_kill (Pid process_pid, bool killChildren=true) |
| void | process_send_signal (Pid process_pid, Posix.Signal sig, bool children=true) |
| void | process_set_priority (Pid procID, int prio) |
| int | process_get_priority (Pid procID) |
| void | process_set_priority_normal (Pid procID) |
| void | process_set_priority_low (Pid procID) |
Variables | |
| string | TEMP_DIR |
|
static |
Definition at line 283 of file TeeJee.Process.vala.
References cmd_exists().
Referenced by cmd_exists(), and TeeJee.System.exo_open_folder().
| int TeeJee.ProcessHelper.exec_script_async | ( | string | script | ) |
Definition at line 171 of file TeeJee.Process.vala.
References Error, exec_script_async(), TeeJee.Logging.log_error(), save_bash_script_temp(), and TEMP_DIR.
Referenced by exec_script_async(), and TeeJee.System.exo_open_folder().
| int TeeJee.ProcessHelper.exec_script_sync | ( | string | script, |
| out string? | std_out = null, | ||
| out string? | std_err = null, | ||
| bool | supress_errors = false, | ||
| bool | run_as_admin = false, | ||
| bool | cleanup_tmp = true, | ||
| bool | print_to_terminal = false ) |
Definition at line 84 of file TeeJee.Process.vala.
References Error, TeeJee.FileSystem.escape_single_quote(), exec_script_sync(), TeeJee.FileSystem.file_delete(), TeeJee.FileSystem.file_parent(), TeeJee.Logging.log_error(), save_bash_script_temp(), and TEMP_DIR.
Referenced by Main.check_and_repair_filesystems(), exec_script_sync(), Device.get_block_devices_using_blkid(), init_tmp(), Device.luks_lock(), Device.luks_unlock(), Main.restore_current_console(), Main.restore_execute_btrfs(), Main.restore_other_console(), Main.restore_other_gui(), Main.run_post_backup_hooks(), and Device.unmount().
| int TeeJee.ProcessHelper.exec_sync | ( | string | cmd, |
| out string? | std_out = null, | ||
| out string? | std_err = null ) |
Definition at line 67 of file TeeJee.Process.vala.
References Error, exec_sync(), and TeeJee.Logging.log_error().
Referenced by CronTab.add_job(), Device.automount_udisks_iso(), SnapshotRepo.build_synthetic_device_for_path(), Main.check_and_remove_timeshift_btrfs(), Main.cleanup_unmount_devices(), Main.create_pre_restore_snapshot_btrfs(), Main.create_snapshot_with_btrfs(), CronTab.crontab_read_all(), exec_sync(), TeeJee.FileSystem.file_gzip(), Device.find_child_devices_using_dmsetup(), Device.get_block_devices_using_lsblk(), Device.get_disk_space_using_df(), CronTab.install(), Device.mount(), SmbMount.mount(), Main.query_subvolume_id(), Main.query_subvolume_quota(), Subvolume.remove(), CronTab.remove_job(), Subvolume.restore(), and Device.test_lsblk_version().
|
static |
executes a command as the "normal" unprivileged user async may execute the command as root if the user could not be determined or the name could not be resolved
Definition at line 209 of file TeeJee.Process.vala.
References exec_user_async(), and TeeJee.Logging.log_debug().
Referenced by exec_user_async(), and TeeJee.System.xdg_open().
| string? TeeJee.ProcessHelper.get_env | ( | string[] | env, |
| string | name, | ||
| string? | default_value = null ) |
Definition at line 356 of file TeeJee.Process.vala.
References get_env().
Referenced by get_env().
| int TeeJee.ProcessHelper.get_euid_of_process | ( | Pid | process | ) |
Definition at line 320 of file TeeJee.Process.vala.
References get_euid_of_process(), and TeeJee.Logging.log_debug().
Referenced by get_euid_of_process(), and get_user_process().
| Pid[] TeeJee.ProcessHelper.get_process_children | ( | Pid | parent_pid | ) |
Definition at line 368 of file TeeJee.Process.vala.
References Error, TeeJee.FileSystem.file_read(), get_process_children(), and TeeJee.Logging.log_error().
Referenced by get_process_children(), and process_send_signal().
| string?[] TeeJee.ProcessHelper.get_process_env | ( | Pid | pid | ) |
Definition at line 348 of file TeeJee.Process.vala.
References TeeJee.FileSystem.file_read_array(), and get_process_env().
Referenced by get_process_env().
| string TeeJee.ProcessHelper.get_process_exe_name | ( | long | pid = -1 | ) |
Definition at line 290 of file TeeJee.Process.vala.
References Error, and get_process_exe_name().
Referenced by AppLock.create(), and get_process_exe_name().
| Pid TeeJee.ProcessHelper.get_process_parent | ( | Pid | process = -1 | ) |
Definition at line 304 of file TeeJee.Process.vala.
References TeeJee.FileSystem.file_read(), get_process_parent(), and TeeJee.Logging.log_debug().
Referenced by get_process_parent(), and get_user_process().
| string TeeJee.ProcessHelper.get_temp_file_path | ( | ) |
Definition at line 274 of file TeeJee.Process.vala.
References get_temp_file_path(), TEMP_DIR, and TeeJee.Misc.timestamp_numeric().
Referenced by CronTab.add_job(), get_temp_file_path(), CronTab.remove_job(), and save_bash_script_temp().
| Pid TeeJee.ProcessHelper.get_user_process | ( | ) |
Definition at line 332 of file TeeJee.Process.vala.
References get_euid_of_process(), get_process_parent(), and get_user_process().
Referenced by get_user_process().
|
static |
Definition at line 37 of file TeeJee.Process.vala.
References TeeJee.FileSystem.dir_create(), TeeJee.FileSystem.dir_delete(), exec_script_sync(), init_tmp(), TeeJee.Misc.random_string(), and TEMP_DIR.
Referenced by init_tmp().
| int TeeJee.ProcessHelper.process_get_priority | ( | Pid | procID | ) |
Definition at line 473 of file TeeJee.Process.vala.
References process_get_priority().
Referenced by process_get_priority().
| void TeeJee.ProcessHelper.process_kill | ( | Pid | process_pid, |
| bool | killChildren = true ) |
Definition at line 438 of file TeeJee.Process.vala.
References process_kill(), and process_send_signal().
Referenced by process_kill().
| void TeeJee.ProcessHelper.process_quit | ( | Pid | process_pid, |
| bool | killChildren = true ) |
Definition at line 429 of file TeeJee.Process.vala.
References process_quit(), and process_send_signal().
Referenced by process_quit(), and AsyncTask.stop().
| void TeeJee.ProcessHelper.process_send_signal | ( | Pid | process_pid, |
| Posix.Signal | sig, | ||
| bool | children = true ) |
Definition at line 448 of file TeeJee.Process.vala.
References get_process_children(), and process_send_signal().
Referenced by process_kill(), process_quit(), and process_send_signal().
| void TeeJee.ProcessHelper.process_set_priority | ( | Pid | procID, |
| int | prio ) |
Definition at line 465 of file TeeJee.Process.vala.
References process_set_priority().
Referenced by process_set_priority(), process_set_priority_low(), and process_set_priority_normal().
| void TeeJee.ProcessHelper.process_set_priority_low | ( | Pid | procID | ) |
Definition at line 487 of file TeeJee.Process.vala.
References process_set_priority(), and process_set_priority_low().
Referenced by process_set_priority_low().
| void TeeJee.ProcessHelper.process_set_priority_normal | ( | Pid | procID | ) |
Definition at line 480 of file TeeJee.Process.vala.
References process_set_priority(), and process_set_priority_normal().
Referenced by process_set_priority_normal().
| string? TeeJee.ProcessHelper.save_bash_script_temp | ( | string | commands, |
| string? | script_path = null, | ||
| bool | force_locale = true, | ||
| bool | supress_errors = false ) |
Definition at line 225 of file TeeJee.Process.vala.
References Error, get_temp_file_path(), TeeJee.Logging.log_error(), and save_bash_script_temp().
Referenced by exec_script_async(), exec_script_sync(), AsyncTask.prepare(), Main.restore_current_gui(), and save_bash_script_temp().
| string TeeJee.ProcessHelper.TEMP_DIR |
Definition at line 31 of file TeeJee.Process.vala.
Referenced by AsyncTask.AsyncTask(), Main.estimate_system_size(), exec_script_async(), exec_script_sync(), TerminalWindow.execute_script(), Main.exit_app(), get_temp_file_path(), init_tmp(), and TerminalWindow.start_shell().