From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DEF0F43B7B; Tue, 27 Feb 2024 19:09:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC5CC40A6B; Tue, 27 Feb 2024 19:09:53 +0100 (CET) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) by mails.dpdk.org (Postfix) with ESMTP id 5851140150 for ; Tue, 27 Feb 2024 19:09:52 +0100 (CET) Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6e48a8304a7so1979504a34.0 for ; Tue, 27 Feb 2024 10:09:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709057391; x=1709662191; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=yVudwPIwzW1DY+NeQLkxAo8XYFGGtQr42qw0YFiXk+M=; b=DBl9wuSQTuRYosgp85wZb0dgX0FejIVFIdFJwrVp6ap/2Jujgviqj5WzrZok25GvKW l7sPXbvst1ionGH4PvThQhlXZ2cLyhEURMe36c7B0EnGMiclI8Nkey/0kGAG5FL7pC7e uisKyOS+OcKtH4XfjWo7rIPaojJpLqN12HdfxE76aNuoiwB9s01R0LiVKhYeoFlxPEID rdnPTaWORmjfDj+nQXE92ZJxrFknefoBXgUmP6g5zsrXrWoZppujidLkQ5Q80jbL0Ods Z3L/zXlr2PrubIImTEkswu4fd7FGhyHuyUni/eb1YOJXHfzze9ga96drt1Xs2QaljmKs /ZSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709057391; x=1709662191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yVudwPIwzW1DY+NeQLkxAo8XYFGGtQr42qw0YFiXk+M=; b=mL/k/7P7/yxPwLugSFGUAMO5I4p84feEWN8STn6mPZVQDyPYTdQLOXUSJFzQkNn1km M+35+C3nwQjD6yNkVR+n8RpDMJsylfGMi28zgBHKCm/1C0uG863iRpeoZ/1YlpCXklpK VEXDdkGDrdb0qT1JMnKsboLE04WcdpN5PVUfmX7EytMUanZTb1XYmDXnn6DGajuyOr7Q fwJtMn6NMf4379dLfQ3BgHAm4alQ6MifV4UEgAY+lvIXDg8lmzw5Vo4RWXwCVXaSFYm2 F+RgKJT/hRDRCoXx9ik5ybkcWMgmS8rKStIytYXLgVM70l2DW+0X1O2Z4fPZeYzqWoxJ sPIA== X-Gm-Message-State: AOJu0Yxj0SBvpgFtzGp17+KDT0k9L0D0J5evYWTF+m1a1frfpc7SyWSQ WvDSKyLats7Pgb3L8hSdRR0BjKq7PRvH1aVk7dFDmvp8qdTuOjExRqf9Uj3g+ppzadamFJ/vk1O W X-Google-Smtp-Source: AGHT+IHCJrmmZ1BTjSkZu6cr0Lix/00dbtwYjlrapHiSntSexU5o4EvdhAJxVGW5OJsBeDN1BizeOA== X-Received: by 2002:a9d:560e:0:b0:6e4:94a5:980f with SMTP id e14-20020a9d560e000000b006e494a5980fmr9316925oti.23.1709057391434; Tue, 27 Feb 2024 10:09:51 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id y7-20020a655287000000b005dc98d9114bsm5278407pgp.43.2024.02.27.10.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:09:51 -0800 (PST) Date: Tue, 27 Feb 2024 10:09:49 -0800 From: Stephen Hemminger To: "Pattan, Reshma" Cc: "dev@dpdk.org" Subject: Re: [PATCH 2/2] app/pdump: handle SIGTERM and SIGHUP Message-ID: <20240227100949.73742a13@hermes.local> In-Reply-To: References: <20240226205143.66702-1-stephen@networkplumber.org> <20240226205143.66702-3-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 27 Feb 2024 09:59:37 +0000 "Pattan, Reshma" wrote: > > -----Original Message----- > > From: Stephen Hemminger > > + sigaction(SIGHUP, NULL, &origaction); > > Why do we need this ? Can't be this direct sigaction(SIGHUP, &action, NULL) without a below if code? > Can you please explain how this works. > > > + if (origaction.sa_handler == SIG_DFL) > > + sigaction(SIGHUP, &action, NULL); > > > If sighup is being ignored already (for example being run by nohup) then the program should keep ignoring SIGHUP. This is the method used in tshark and dumpcap utilities in wireshark and it made sense.