Skip to content
Snippets Groups Projects
Commit 22e886a9 authored by Pavel Vondruska's avatar Pavel Vondruska
Browse files

Cistka souboru a uprava komentare

parent 0d913f65
No related branches found
No related tags found
No related merge requests found
Pipeline #20902 passed
// Copyright (c) 2018-2021, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the sources of this project regarding your
// rights to use or distribute this software.
package main
import (
"log"
"log/syslog"
"os"
"os/user"
"strings"
"fmt"
"github.com/sylabs/singularity/v4/cmd/internal/cli"
"github.com/sylabs/singularity/v4/internal/pkg/buildcfg"
useragent "github.com/sylabs/singularity/v4/pkg/util/user-agent"
)
func main() {
logger, err := syslog.New(syslog.LOG_INFO|syslog.LOG_USER, "singularity-start")
if err != nil {
log.Fatalf("Error while connecting to syslog: %v", err)
}
defer logger.Close()
currentUser, err := user.Current()
if err != nil {
currentUser = &user.User{Username: "unknown"}
}
hostname, err := os.Hostname()
if err != nil {
hostname = "unknown-host"
}
pbsJobID := os.Getenv("PBS_JOBID")
if pbsJobID == "" {
pbsJobID = "out-of-job"
}
cmd := os.Args[0]
args := strings.Join(os.Args[1:], " ")
message := fmt.Sprintf("%s@%s %s %s %s", currentUser.Username, hostname, pbsJobID, cmd, args)
logger.Info(message)
useragent.InitValue(buildcfg.PACKAGE_NAME, buildcfg.PACKAGE_VERSION)
// In cmd/internal/cli/singularity.go
cli.ExecuteSingularity()
}
...@@ -71,7 +71,7 @@ curl -LO https://proot.gitlab.io/proot/bin/proot ...@@ -71,7 +71,7 @@ curl -LO https://proot.gitlab.io/proot/bin/proot
chmod +x ./proot chmod +x ./proot
echo "proot usr/bin" >> debian/singularity-ce.install echo "proot usr/bin" >> debian/singularity-ce.install
# Kopie upraveneho cli.go kvuli logovani pouziti do syslogu # Patch upraveneho cli.go kvuli logovani pouziti do syslogu
#cp -v ${ROOTPWD}/cli.go cmd/singularity/cli.go #cp -v ${ROOTPWD}/cli.go cmd/singularity/cli.go
cp -vr ${ROOTPWD}/debian/patches debian/ cp -vr ${ROOTPWD}/debian/patches debian/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment