added getopt, listens also on unix socket