goinsu 0.2.0

Switch user, group and execute a program


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

goinsu Page on DUBLicenseTravisCICircleCI

goinsu - a simple su which doesn't mess with TTY and other stuff. It is as simple as "Hey, run this program as this user".

Why?

$ docker run -it --rm ubuntu:trusty su -c "ps aux"
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  7.0  0.0  46644  2628 pts/0    Ss+  19:07   0:00 su -c ps aux
root         7  0.0  0.0  15584  2100 ?        Rs   19:07   0:00 ps aux
$ docker run -it --rm ubuntu:trusty sudo ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  7.0  0.0  46028  3044 pts/0    Ss+  19:07   0:00 sudo ps aux
root         6  0.0  0.0  15584  2140 pts/0    R+   19:07   0:00 ps aux
$ docker run -it --rm -v`pwd`/goinsu:/usr/bin/goinsu ubuntu:trusty goinsu root ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   7152   852 pts/0    Rs+  19:08   0:00 ps aux

Why reinvent gosu?

goinsu does the same thing but in 10KB (well, 50KB if compiled as a static executable) instead of 1.8MB.

Why reinvent su-exec?

goinsu is written in the D programming language, which is a high-level programming language with metaprogramming, CTFE, and other cool things you can't find in C.

betterC?

Yep. goinsu written in a subset of the D programming language, called betterC. Just google for it, ya' know.

Alternatives

You can use gosu or su-exec, but they aren't as cool as goinsu.

Authors:
  • Anton Fediushin
Dependencies:
none
Versions:
0.2.0 2018-Jul-22
0.1.0 2017-Nov-03
0.0.3 2017-Sep-28
0.0.2 2017-Sep-18
0.0.1 2017-Sep-16
Show all 6 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 6 downloads total

Score:
0.9
Short URL:
goinsu.dub.pm