File tree Expand file tree Collapse file tree 4 files changed +22
-25
lines changed
Expand file tree Collapse file tree 4 files changed +22
-25
lines changed Original file line number Diff line number Diff line change @@ -100,8 +100,6 @@ func main() {
100100 flags .Foreground = true
101101 }
102102
103- cfg .InitLoggers (flags )
104-
105103 if ! flags .Foreground {
106104 daemonizer = NewDaemonizer ()
107105 // Do not close stderr before mounting to print mount errors
@@ -114,6 +112,8 @@ func main() {
114112 }
115113 }
116114
115+ cfg .InitLoggers (flags )
116+
117117 mainLog .Info ().Str ("version" , cfg .Version ).Msg ("Starting TigrisFS version" )
118118 mainLog .Info ().Str ("bucketName" , bucketName ).Str ("mountPoint" , flags .MountPoint ).Msg ("Mounting" )
119119 mainLog .Info ().Uint32 ("uid" , flags .Uid ).Uint32 ("defaultGid" , flags .Gid ).Msg ("Default uid=gid" )
@@ -148,6 +148,7 @@ func main() {
148148 mainLog .Info ().Msg ("File system has been successfully mounted." )
149149 if ! flags .Foreground {
150150 daemonizer .NotifySuccess (true )
151+ mainLog .Debug ().Msg ("Process is daemonized. Closing stdout and stderr." )
151152 mainLog .E (os .Stderr .Close ())
152153 mainLog .E (os .Stdout .Close ())
153154 }
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ import (
3232 daemon "github.com/sevlyar/go-daemon"
3333 "github.com/tigrisdata/tigrisfs/core"
3434 "github.com/tigrisdata/tigrisfs/core/cfg"
35- "github.com/tigrisdata/tigrisfs/log"
3635)
3736
3837var signalsToHandle = []os.Signal {os .Interrupt , syscall .SIGTERM , syscall .SIGUSR1 }
@@ -92,17 +91,13 @@ func (p *Daemonizer) Daemonize(logFile string) error {
9291 }
9392
9493 if child != nil {
95- log .Debug ().Int ("pid" , os .Getpid ()).Msg ("parent" )
9694 // attempt to wait for child to notify parent
9795 if p .Wait () {
98- log .Debug ().Int ("pid" , os .Getpid ()).Msg ("parent exiting" )
9996 os .Exit (0 )
10097 } else {
101- log .Debug ().Int ("pid" , os .Getpid ()).Msg ("inval" )
10298 return syscall .EINVAL
10399 }
104100 } else {
105- log .Debug ().Int ("pid" , os .Getpid ()).Msg ("child" )
106101 p .Cancel ()
107102 mainLog .E (ctx .Release ())
108103 }
Original file line number Diff line number Diff line change @@ -18,21 +18,21 @@ set -ex
1818. " $( dirname " $0 " ) /../mount.sh"
1919
2020CASE=posix_meta
21- DIR=$MNT_DIR /$CASE /$RANDOM
21+ DIR=" $MNT_DIR /$CASE /$RANDOM "
2222
2323df -h
2424
25- mkdir -p $DIR
26- fn=$DIR /file.$RANDOM
27- touch $fn
28- [ " $( stat -c ' %G' $fn ) " == " $USER " ]
29- chown $USER :users $fn
30- [ " $( stat -c ' %G' $fn ) " == " users" ]
31- touch $fn
32- [ " $( stat -c ' %G' $fn ) " == " users" ]
25+ mkdir -p " $DIR "
26+ fn=" $DIR /file.$RANDOM "
27+ touch " $fn "
28+ [ " $( stat -c ' %G' $fn ) " == " $USER " ] || exit 1
29+ chown " $USER :users" " $fn "
30+ [ " $( stat -c ' %G' " $fn " ) " == " users" ] || exit 1
31+ touch " $fn "
32+ [ " $( stat -c ' %G' $fn ) " == " users" ] || exit 1
3333
34- _umount $MNT_DIR
35- FS_BIN=$( dirname " $0 " ) /../../tigrisfs _mount $MNT_DIR --enable-perms
34+ _umount " $MNT_DIR "
35+ FS_BIN=$( dirname " $0 " ) /../../tigrisfs _mount " $MNT_DIR " --enable-specials --enable-perms
3636sleep 5
3737
38- [ " $( stat -c ' %G' $fn ) " == " users" ]
38+ [ " $( stat -c ' %G' $fn ) " == " users" ] || exit 1
Original file line number Diff line number Diff line change 22
33set -ex
44
5- export MNT_DIR=$( mktemp -d)
5+ MNT_DIR=$( mktemp -d)
6+ export MNT_DIR
67
7- export BUCKET_NAME=" tigrisfs-test"
8- export ENDPOINT=" http://localhost:8080"
8+ export BUCKET_NAME=" tigrisfs-test. $RANDOM "
9+ export ENDPOINT=${ENDPOINT :- " http://localhost:8080" }
910
1011. " $( dirname " $0 " ) /mount.sh"
1112
1213_s3cmd mb s3://$BUCKET_NAME
1314
14- _mount " $MNT_DIR " --enable-perms
15- trap " _umount $MNT_DIR " EXIT
15+ _mount " $MNT_DIR " --enable-specials --enable- perms
16+ trap ' _umount $MNT_DIR' EXIT
1617
1718sleep 5
1819
1920for c in $( find test/cases -type f -name " *.sh" ) ; do
2021 echo " Running $c "
2122 /bin/bash " $c "
22- done
23+ done
You can’t perform that action at this time.
0 commit comments