server, service: added running as effective user
This commit is contained in:
@@ -36,6 +36,7 @@ type Config struct {
|
||||
RunPath string `json:"runfile" yaml:"runfile"`
|
||||
AsDaemon bool `json:"asDaemon" yaml:"asDaemon"`
|
||||
LogLimit int64 `json:"logLimit" yaml:logLimit`
|
||||
RunUser string `json:"runUser" yaml:runUser`
|
||||
}
|
||||
|
||||
func NewConfig() (*Config, error) {
|
||||
@@ -45,6 +46,7 @@ func NewConfig() (*Config, error) {
|
||||
},
|
||||
AsDaemon: false,
|
||||
LogLimit: 1024 * 1024 * 10, // 10 Mb
|
||||
RunUser: "daemon",
|
||||
}
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
confdirPath = "/home/ziggi/Projects/minilb/etc/minilb"
|
||||
rundirPath = "/home/ziggi/Projects/minilb/tmp/run"
|
||||
logdirPath = "/home/ziggi/Projects/minilb/tmp/log"
|
||||
datadirPath = "/home/ziggi/Projects/minilb/tmp/data"
|
||||
packageVersion = "0.0.1"
|
||||
confdirPath = "/etc/minilb"
|
||||
rundirPath = "/var/run/minilb"
|
||||
logdirPath = "/var/log/minilb"
|
||||
datadirPath = "/var/lib/minilb"
|
||||
pkgVersion = "0.0.1"
|
||||
runUser = "daemon"
|
||||
)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
confdirPath = "@srv_confdir@"
|
||||
rundirPath = "@srv_rundir@"
|
||||
logdirPath = "@srv_logdir@"
|
||||
datadirPath = "@srv_datadir@"
|
||||
packageVersion = "@PACKAGE_VERSION@"
|
||||
confdirPath = "@srv_confdir@"
|
||||
rundirPath = "@srv_rundir@"
|
||||
logdirPath = "@srv_logdir@"
|
||||
datadirPath = "@srv_datadir@"
|
||||
pkgVersion = "@PACKAGE_VERSION@"
|
||||
runUser = "@run_user@"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user