evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.91k stars 509 forks source link

Restoring connect opensnitch-ui #225

Closed denji closed 5 years ago

denji commented 5 years ago

We need a procedure to restoring connect opensnitch-ui after the fall of the demon opensnitchd and restarting opensnitchd.service.


systemd[1]: Starting OpenSnitch is a GNU/Linux port of the Little Snitch application firewall....
systemd[1]: Started OpenSnitch is a GNU/Linux port of the Little Snitch application firewall..
opensnitchd[1018]: Error sending packet to queue channel .....
opensnitchd[1018]: Error sending packet to queue channel .....
opensnitchd[1018]: fatal error: concurrent map read and map write
opensnitchd[1018]: goroutine 77 [running]:
opensnitchd[1018]: runtime.throw(.......)
opensnitchd[1018]:         /usr/local/go/src/runtime/panic.go:608 ......
opensnitchd[1018]: runtime.mapaccess2(....)
opensnitchd[1018]:         /usr/local/go/src/runtime/map.go:453 ....
opensnitchd[1018]: reflect.mapaccess(....)
opensnitchd[1018]:         /usr/local/go/src/runtime/map.go:1249 .....
opensnitchd[1018]: reflect.Value.MapIndex(....)
opensnitchd[1018]:         /usr/local/go/src/reflect/value.go:1111 .....
opensnitchd[1018]: github.com/evilsocket/opensnitch/daemon/vendor/github.com/golang/protobuf/proto.(*Buffer).enc_new_map(.....)
opensnitchd[1018]:         /home/.../go/src/github.com/evilsocket/opensnitch/daemon/vendor/github.com/golang/protobuf/proto/encode.go:1159 ....
opensnitchd[1018]: github.com/evilsocket/opensnitch/daemon/vendor/github.com/golang/protobuf/proto.(*Buffer).enc_struct(....)
opensnitchd[1018]:         /home/.../go/src/github.com/evilsocket/opensnitch/daemon/vendor/github.com/golang/protobuf/proto/encode.go:1235 ....
`
gustavo-iniguez-goya commented 5 years ago

At least on Debian, systemd restores the daemon if it exits with error (after 30s). And the ui is updated as expected:


(...)
jun 17 21:21:07 opensnitchd[25020]: created by github.com/evilsocket/opensnitch/daemon/vendor/google.golang.org/grpc/transport.newHTTP2Client
jun 17 21:21:07 opensnitchd[25020]:         /home/test/go/src/github.com/evilsocket/opensnitch/daemon/vendor/google.golang.org/grpc/transport/http2_client.go:289 +0xcc6
jun 17 21:21:07  systemd[1]: opensnitchd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
jun 17 21:21:37  systemd[1]: opensnitchd.service: Service RestartSec=30s expired, scheduling restart.
jun 17 21:21:37  systemd[1]: opensnitchd.service: Scheduled restart job, restart counter is at 2.
jun 17 21:21:37  systemd[1]: Stopped OpenSnitch is a GNU/Linux port of the Little Snitch application firewall..
jun 17 21:21:37  systemd[1]: Starting OpenSnitch is a GNU/Linux port of the Little Snitch application firewall....
jun 17 21:21:37  systemd[1]: Started OpenSnitch is a GNU/Linux port of the Little Snitch application firewall..

If the connection to the UI is not restored maybe it's a different problem. journalctl/daemon logs would be helpful