Skip to content

Commit

Permalink
Merge pull request #2065 from timopollmeier/remove-gvmd-from-proctitle
Browse files Browse the repository at this point in the history
Fix: Remove extra "gvmd: " from process titles
  • Loading branch information
timopollmeier authored Aug 31, 2023
2 parents bcabb68 + 6262b3e commit 7b47659
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 52 deletions.
62 changes: 31 additions & 31 deletions src/gvmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ accept_and_maybe_fork (int server_socket, sigset_t *sigmask_current)
init_sentry ();
is_parent = 0;

setproctitle ("gvmd: Serving client");
setproctitle ("Serving client");

/* Restore the sigmask that was blanked for pselect. */
pthread_sigmask (SIG_SETMASK, sigmask_current, NULL);
Expand Down Expand Up @@ -736,7 +736,7 @@ fork_connection_internal (gvm_connection_t *client_connection,
/* Child. Serve the scheduler GMP, then exit. */

init_sentry ();
setproctitle ("gvmd: Serving GMP internally");
setproctitle ("Serving GMP internally");

parent_client_socket = sockets[0];

Expand Down Expand Up @@ -834,7 +834,7 @@ fork_connection_internal (gvm_connection_t *client_connection,

g_debug ("%s: %i forked %i", __func__, getpid (), pid);

setproctitle ("gvmd: Requesting GMP internally");
setproctitle ("Requesting GMP internally");

/* This process is returned as the child of
* fork_connection_for_scheduler so that the returned parent can wait
Expand Down Expand Up @@ -1105,7 +1105,7 @@ handle_sigabrt_simple (int signal)
static int
update_nvt_cache_osp (const gchar *update_socket)
{
setproctitle ("gvmd: OSP: Updating NVT cache");
setproctitle ("OSP: Updating NVT cache");

return manage_update_nvts_osp (update_socket);
}
Expand All @@ -1121,7 +1121,7 @@ update_nvt_cache_osp (const gchar *update_socket)
static int
update_nvt_cache_retry ()
{
setproctitle ("gvmd: Reloading NVTs");
setproctitle ("Reloading NVTs");

/* Don't ignore SIGCHLD, in order to wait for child process. */
setup_signal_handler (SIGCHLD, SIG_DFL, 0);
Expand Down Expand Up @@ -1216,7 +1216,7 @@ fork_update_nvt_cache ()
/* Child. */

init_sentry ();
setproctitle ("gvmd: Updating NVT cache");
setproctitle ("Updating NVT cache");

/* Clean up the process. */

Expand Down Expand Up @@ -1327,7 +1327,7 @@ fork_feed_sync ()
/* Child. */

init_sentry ();
setproctitle ("gvmd: Synchronizing feed data");
setproctitle ("Synchronizing feed data");

/* Clean up the process. */

Expand Down Expand Up @@ -2379,7 +2379,7 @@ gvmd (int argc, char** argv, char *env[])
/* Set process title. */

setproctitle_init (argc, argv, env);
setproctitle ("gvmd: Initializing");
setproctitle ("Initializing");

/* Setup initial signal handlers. */

Expand Down Expand Up @@ -2574,7 +2574,7 @@ gvmd (int argc, char** argv, char *env[])
return EXIT_FAILURE;
}

setproctitle ("gvmd: Migrating database");
setproctitle ("Migrating database");

g_info (" Migrating database.");

Expand Down Expand Up @@ -2659,7 +2659,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Optimizing");
setproctitle ("Optimizing");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2675,7 +2675,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: --rebuild");
setproctitle ("--rebuild");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2697,7 +2697,7 @@ gvmd (int argc, char** argv, char *env[])

error_msg = NULL;

setproctitle ("gvmd: --rebuild-gvmd-data");
setproctitle ("--rebuild-gvmd-data");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2722,7 +2722,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: --rebuild-scap");
setproctitle ("--rebuild-scap");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2741,7 +2741,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: --dump-vt-verification");
setproctitle ("--dump-vt-verification");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2764,7 +2764,7 @@ gvmd (int argc, char** argv, char *env[])

/* Create the scanner and then exit. */

setproctitle ("gvmd: Creating scanner");
setproctitle ("Creating scanner");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand Down Expand Up @@ -2816,7 +2816,7 @@ gvmd (int argc, char** argv, char *env[])

/* Modify the scanner and then exit. */

setproctitle ("gvmd: Modifying scanner");
setproctitle ("Modifying scanner");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand Down Expand Up @@ -2860,7 +2860,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Checking alerts");
setproctitle ("Checking alerts");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2875,7 +2875,7 @@ gvmd (int argc, char** argv, char *env[])
if (create_encryption_key)
{
int ret;
setproctitle ("gvmd: Creating encryption key");
setproctitle ("Creating encryption key");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2890,7 +2890,7 @@ gvmd (int argc, char** argv, char *env[])
if (set_encryption_key)
{
int ret;
setproctitle ("gvmd: Setting encryption key");
setproctitle ("Setting encryption key");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2907,7 +2907,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Creating user");
setproctitle ("Creating user");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2924,7 +2924,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Deleting user");
setproctitle ("Deleting user");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2940,7 +2940,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Getting roles");
setproctitle ("Getting roles");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2956,7 +2956,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Getting users");
setproctitle ("Getting users");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2972,7 +2972,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Getting scanners");
setproctitle ("Getting scanners");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -2988,7 +2988,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Deleting scanner");
setproctitle ("Deleting scanner");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -3004,7 +3004,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Verifying scanner");
setproctitle ("Verifying scanner");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -3020,7 +3020,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Modifying user password");
setproctitle ("Modifying user password");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -3036,7 +3036,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Modifying setting");
setproctitle ("Modifying setting");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -3053,7 +3053,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Encrypting all credentials");
setproctitle ("Encrypting all credentials");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand All @@ -3069,7 +3069,7 @@ gvmd (int argc, char** argv, char *env[])
{
int ret;

setproctitle ("gvmd: Decrypting all credentials");
setproctitle ("Decrypting all credentials");

if (option_lock (&lockfile_checking))
return EXIT_FAILURE;
Expand Down Expand Up @@ -3320,7 +3320,7 @@ gvmd (int argc, char** argv, char *env[])

/* Enter the main forever-loop. */

setproctitle ("gvmd: Waiting for incoming connections");
setproctitle ("Waiting for incoming connections");
serve_and_schedule ();

gvm_close_sentry ();
Expand Down
10 changes: 5 additions & 5 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,7 @@ fork_osp_scan_handler (task_t task, target_t target, int from,
exit (-1);
}

setproctitle ("gvmd: OSP: Handling scan %s", report_id);
setproctitle ("OSP: Handling scan %s", report_id);

rc = handle_osp_scan (task, global_current_report, report_id);
g_free (report_id);
Expand Down Expand Up @@ -3217,7 +3217,7 @@ fork_cve_scan_handler (task_t task, target_t target)

set_task_run_status (task, TASK_STATUS_RUNNING);

setproctitle ("gvmd: CVE: Handling scan %s", report_id);
setproctitle ("CVE: Handling scan %s", report_id);
g_free (report_id);

hosts = target_hosts (target);
Expand Down Expand Up @@ -4764,7 +4764,7 @@ scheduled_task_start (scheduled_task_t *scheduled_task,

/* Parent. Wait for child, to check return. */

setproctitle ("gvmd: scheduler: waiting for %i", pid);
setproctitle ("scheduler: waiting for %i", pid);

g_debug ("%s: %i fork_connectioned %i",
__func__, getpid (), pid);
Expand Down Expand Up @@ -4865,7 +4865,7 @@ scheduled_task_start (scheduled_task_t *scheduled_task,

/* Start the task. */

setproctitle ("gvmd: scheduler: starting %s", scheduled_task->task_uuid);
setproctitle ("scheduler: starting %s", scheduled_task->task_uuid);

auth_opts = gmp_authenticate_info_opts_defaults;
auth_opts.username = scheduled_task->owner_name;
Expand Down Expand Up @@ -4956,7 +4956,7 @@ scheduled_task_stop (scheduled_task_t *scheduled_task,

/* Stop the task. */

setproctitle ("gvmd: scheduler: stopping %s",
setproctitle ("scheduler: stopping %s",
scheduled_task->task_uuid);

auth_opts = gmp_authenticate_info_opts_defaults;
Expand Down
8 changes: 4 additions & 4 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -9633,7 +9633,7 @@ alert_script_exec (const char *alert_id, const char *command_args,
init_sentry ();
cleanup_manage_process (FALSE);

setproctitle ("gvmd: Running alert script");
setproctitle ("Running alert script");

if (setgroups (0,NULL))
{
Expand Down Expand Up @@ -10446,7 +10446,7 @@ send_to_sourcefire (const char *ip, const char *port, const char *pkcs12_64,
init_sentry ();
cleanup_manage_process (FALSE);

setproctitle ("gvmd: Sending to Sourcefire");
setproctitle ("Sending to Sourcefire");

if (setgroups (0,NULL))
{
Expand Down Expand Up @@ -10775,7 +10775,7 @@ send_to_verinice (const char *url, const char *username, const char *password,
{
/* Child. Drop privileges, run command, exit. */
init_sentry ();
setproctitle ("gvmd: Sending to Verinice");
setproctitle ("Sending to Verinice");

cleanup_manage_process (FALSE);

Expand Down Expand Up @@ -20905,7 +20905,7 @@ create_report (array_t *results, const char *task_id, const char *in_assets,
}
}

setproctitle ("gvmd: Importing results");
setproctitle ("Importing results");

/* Add the results. */

Expand Down
2 changes: 1 addition & 1 deletion src/manage_sql_report_formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,7 @@ run_report_format_script (gchar *report_format_id,
/* Child. Drop privileges, run command, exit. */

init_sentry ();
setproctitle ("gvmd: Generating report");
setproctitle ("Generating report");

cleanup_manage_process (FALSE);

Expand Down
Loading

0 comments on commit 7b47659

Please sign in to comment.