Comments (7)
there's plenty of ways to background a task:
- nohup
- screen
- tmux
- inetd
- write your own simple systemd service script
[Unit]
Description=My Service NAME
After=network.target
[Service]
Type=simple
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME/
ExecStart=/path/to/binary
Restart=always #on-failure # or always, on-abort, etc
[Install]
WantedBy=multi-user.target
save as /etc/systemd/system/SERVICENAME.service
from microsocks.
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
void daemonize(void) {
pid_t pid = fork();
if (pid < 0) {
exit(1);
}
if (pid > 0) exit(0);
setsid(); /* obtain a new process group */
int fd;
for (fd = getdtablesize(); fd >= 0; --fd) close(fd); /* close all descriptors */
fd = open("/dev/null", O_RDWR); dup(fd); dup(fd); /* handle standart I/O */
}
here's the code to deamonize (from libulz), you can add it to the file and call it from main() but i think your issue is PEBKAC so i'm not gonna put this into the official version...
from microsocks.
of course can solved rudimentary with "--make-pidfile" and "--background" but there's some plans to make the program background? (i already know its light and simple but well..)
from microsocks.
thanks @rofl0r but as i said, i created but the binary does not acept the parameters (custon port sources from a file)
the service name and the init daemon works as i posted in second comment, but due the nature of the executable, does not permit control, reload or parse custom parameters..
from microsocks.
the key point of my answer (but maybe it was not clear since i didn't state it explicitly) is that there are so many ways you can background a task via standard tools that i don't see the need to add the functionality to microsocks itself.
if you want to background it for the duration of your computer's uptime, i'd recommend you just start screen
, and then launch microsocks from within that screen session, then close the terminal. if you want to have it booted automatically on startup, use a systemd service.
from microsocks.
yeah, it works with noup, also with screen, but only if i do manually.. i mean if i put in other script and try to automatically pass arguments, seems do not work.. dont worry, too busy for simple task.. thanks in any case.
from microsocks.
hey solved! was a stupid misctake, the parse variable for the arguments was different, i could not see due i use a remote screen so image are blurry and well..
i made a debian package if interesting.. for Debian 7, 8, and 9, for debian 6, 5, and 4 too bit at venenux mail list.. here-s the procedure to install:
https://software.opensuse.org//download.html?project=home%3Avegnuli%3Ainternet&package=microsocks
echo 'deb http://download.opensuse.org/repositories/home:/vegnuli:/internet/Debian_$(lsb_release -s -r | cut -d . -f 1).0/ /' > /etc/apt/sources.list.d/home:vegnuli:internet.list
apt-get update
apt-get install microsocks
from microsocks.
Related Issues (20)
- Parameter -q (quiet) to disable logging HOT 2
- FR: whitelist IP address in parameter HOT 6
- Use custom DNS HOT 20
- Can't connect to `0.0.0.0` on client HOT 4
- Connect to server running on the same machine HOT 17
- microsocks-1.0.2-x86_64-static may contain security issues HOT 1
- EC_TTL_EXPIRED error is sent down idle connection, and treated as application-layer traffic by client
- microsocks: not found HOT 1
- Configuration of the Proxy HOT 1
- Blocking some IPs HOT 1
- Any plans to support UDP? HOT 2
- Allow passthrough of TCP/ip headers HOT 1
- a little Suggest. Change release url to https HOT 1
- Any chance of a new release with -q flag added? HOT 2
- Disconnect logging
- Using 443 Port HOT 1
- buffer overflow detected HOT 6
- Bandwidth testing tools HOT 5
- add systemd service file HOT 3
- Trying IPv6 sockets w/ IPv6 being available but down, leads to connection failures HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsocks.