:: Re: [DNG] How to test the backend o…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: KatolaZ
Ημερομηνία:  
Προς: DNG
Αντικείμενο: Re: [DNG] How to test the backend of simple-netaid
On Tue, Mar 19, 2019 at 11:00:59AM +0100, aitor_czr wrote:

[cut]

>
> I answer myself, referring to the use of pkill wpa_supplicant:
>
> #include <signal.h>
>
> int kill_wpa_supplicant(void)
> {
>     pid_t wpa_pid;
>     FILE *fp;
>
>     fp = (fopen("/var/run/wpa_supplicant.pid", "r"));
>     if (fp == NULL) {
>         printf("Couldn't read Wpasupplicant pid file, not trying to kill.");
>         return 0;


aitor, please notice that the pid file for wpa_supplicant can be
literally *anywhere*. At the moment, in Devuan Beowulf, it is stored
in the folder /var/run/wpa_supplicant/. But this is just very
unreliable, IMHO. Please also consider that `wpa_supplicant(8)` has an
option "-P" that allows to specify the path to pidfile...

My2Cents

KatolaZ

-- 
[ ~.,_  Enzo Nicosia aka KatolaZ - Devuan -- Freaknet Medialab  ]  
[     "+.  katolaz [at] freaknet.org --- katolaz [at] yahoo.it  ]
[       @)   http://kalos.mine.nu ---  Devuan GNU + Linux User  ]
[     @@)  http://maths.qmul.ac.uk/~vnicosia --  GPG: 0B5F062F  ] 
[ (@@@)  Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ  ]