[Swan-dev] debian /usr/lib/ipsec/portexcludes: /usr/bin/python2: bad interpreter: No such file or directory

Antony Antony antony at phenome.org
Thu Apr 5 13:58:12 UTC 2018


"ipsec start" fails on debian. It seems systemd/ipsec.service fails.

the python dependencies should be ideally optional build option. think of embedded systems without python...

and definately not hard coding to python2.

journalctl -xe

Apr 05 13:31:03 swanbase systemd[10604]: ipsec.service: Failed to execute command: No such file or directory
Apr 05 13:31:03 swanbase systemd[10604]: ipsec.service: Failed at step EXEC spawning /usr/lib/ipsec/portexcludes: No such file or di
-- Subject: Process /usr/lib/ipsec/portexcludes could not be executed
-- Defined-By: systemd

first sid is missing python2,  changing the interpreter line do not seems to fix the issue.

-#!/usr/bin/python2 -tt
+#!/usr/bin/python3 -tt

then ran into 

root at swanbase:/home/build/libreswan#  /usr/lib/ipsec/portexcludes
Traceback (most recent call last):
  File "/usr/lib/ipsec/portexcludes", line 221, in <module>
    main()
  File "/usr/lib/ipsec/portexcludes", line 89, in main
    clear_portrules()
  File "/usr/lib/ipsec/portexcludes", line 47, in clear_portrules
    for line in ret.split("\n"):
TypeError: a bytes-like object is required, not 'str' 


More information about the Swan-dev mailing list