Skip to content
Advertisement

Tag: go

getuid/geteuid strange behaviour

I’ve got a simple code, which basically looks like: Which basically outputs the real and effective user id. Now, once build with: go build main.go; I also call sudo chown root:root main && sudo chmod 4755 main to get -rwsr-xr-x permissions on the file. If I understand the concept of the setuid bit (the s part), it allows me later

Mount entry in fstab with go

Is there a way to mount a ssh device with Go using an entry in fstab where the mount options are defined. I have been trying syscall.Mount without success. 2018/01/20 11:31:07 operation not permitted exit status 1 A user mount using the fstab entry works fine. sshfs#jeanluc@<remote IP>:/home/jeanluc /home/jeanluc/my-mnt/ursule_jeanluc fuse user,noauto,uid=1000,gid=1000,follow_symlinks,defaults 0 0 Edit: Following Marc’s advise below here is

gocql package golang two file version in same install

getting this error when trying to run a go file (which should run) When I look at the documentation of go 1.7 I find that ClusterConfig does have a field ConnectTimeout. (go version = 1.7). If I go to the github.com directory in my go path I find a directory gocql. In this directory I find a file cluster.go which

Understanding Linux write performance

I’ve been doing some benchmarking to try and understand write performance on Linux, and I don’t understand the results I got (I’m using ext4 on Ubuntu 17.04, though I’m more interested in understanding ext4 if anything, than I am in comparing filesystems). Specifically, I understand that some databases/filesystems work by keeping a stale copy of your data, and then writing

Golang Mac OSX build for Docker machine

I need to run Golang application on Docker machine. I’m working on Mac OSX and Docker is working on top of Linux virtual machine, so binaries builded on Mac are not runnable on Docker. I see two ways here: cross-compile binaries on Mac for linux OS copy project sources to docker, run ‘go get’ and ‘go build’ on it First

How do I run a simple Go server as a daemon in Debian?

I recently wrote a simple server in Go: It works perfectly well if compiled and then executed by ./go_http_server &. The problem is that it doesn’t survive reboots. So after some reading, I attempted to daemonize it by placing a script in /etc/init.d: …then running update-rc.d go_http_server defaults, and poof! It runs on boot, as verified by ps -ef |

Send signal to other process

since os/signal is only for handling of incoming signals I’m asking if there is a native way to send signals to other processes? Edit: The process I want to mange is nginx. My Go application should listen for some events and then send a SIGHUP to nginx to reload its configuration Answer If you have created process with os.StartProcess or

Advertisement