Toon posts:

[LINUX] Dedicated CS 1.6 server ERROR

Pagina: 1
Acties:
  • 176 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Hallo mensen, ik heb sinds 3 dagen een dedicated CS 1.6 server gehuurd bij www.itshosted.nl . Alles werkt perfect en dus wou ik vanmorgen metamod installeren. Toen het bijna geinstalleerd was, moest ik een commandline toevoegen aan het startscript van mijn server. Ik heb per ongeluk wat veranderingen gemaakt in mijn hlds_run bestand. ik dacht namelijk dat de commandline daar moest. Nu ik mijn server probeer te starten, krijg ik deze error:

Output from command ..

/bin/sh: ./start: /bin/sh
: bad interpreter: No such file or directory

Ik heb alles terugveranderd naar hoe het eerst was (volgens mij in ieder gval). Ik ben op zoek gegaan naar een hlds_run voor linux op het internet. Maar daar kwam ook niets bruikbaars uit. ik hoop dat iemand weet wat deze error inhoud.....

  • TrailBlazer
  • Registratie: Oktober 2000
  • Laatst online: 07-02 09:48

TrailBlazer

Karnemelk FTW

tik eens which sh in

Verwijderd

Topicstarter
hoe bedoel je intikken? Ik start de server online via een site van www.itshosted.nl . Xplain, s'il vous plaît... en ik zie oowk geen bin map of iets dergelijks

[ Voor 21% gewijzigd door Verwijderd op 25-07-2005 15:03 ]


  • Tha_Butcha
  • Registratie: November 2000
  • Laatst online: 30-01 13:59
het zou helpen als je je script hier neer zet (mits het niet loeigroot is)

maar kijkende naar de error, klopt je eerste regel niet, die moet zoiets zijn:

code:
1
#!/bin/bash


toevoeging: lijkt het je niet handig eerst ff naar je provider/host te gaan, aangezien je ervoor betaald?

[ Voor 23% gewijzigd door Tha_Butcha op 25-07-2005 15:04 . Reden: toevoeging ]

Compromises are for the weak


Verwijderd

Topicstarter
Hier is mijn script van hlds_run:

VERWIJDERD.. check 2 posts hieronder }:O

[ Voor 100% gewijzigd door Verwijderd op 25-07-2005 15:18 ]


  • Leftblank
  • Registratie: Juni 2004
  • Laatst online: 20:28
Zou je _alsjeblieft_ er even [ code ][ /code ] tags omheen kunnen zetten? Dit is écht onleesbaar ;)

[ Voor 2% gewijzigd door Leftblank op 25-07-2005 15:12 . Reden: de UBB codes worden té slim tegenwoordig ]


Verwijderd

Topicstarter
srry, hier is ie tussen code-tags :9

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
#! /bin/sh
#
#       Copyright (c) 2002, Valve LLC. All rights reserved.
#
#   a wrapper script for the main hl dedicated server binary.
#   Performs auto-restarting of the server on crash. You can
#   extend this to log crashes and more.
#

# setup the libraries, local dir first!
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"

init() {
    # Initialises the various variables
    # Set up the defaults
    GAME="valve"
    DEBUG=""
    RESTART="yes"
    HL=./hlds_i486
    HL_DETECT=1
    TIMEOUT=10 # time to wait after a crash (in seconds)
    CRASH_DEBUG_MSG="email debug.log to linux@valvesoftware.com"
    GDB="gdb" # the gdb binary to run
    DEBUG_LOG="debug.log"
    PID_FILE="" # only needed it DEBUG is set so init later
    STEAM=""
    PID_FILE_SET=0
    STEAMERR=""
    SIGINT_ACTION="quit 0" # exit normally on sig int
    NO_TRAP=0
    AUTO_UPDATE=""
    STEAM_USER=""
    STEAM_PASSWORD=""
    PARAMS=$*
                

    # Remove any old default pid files
    # Cant do this as they may be still running
    #rm -f hlds.*.pid

    # use the $FORCE environment variable if its set
    if test -n "$FORCE" ; then
        # Note: command line -binary will override this
        HL=$FORCE
        HL_DETECT=0
    fi

    while test $# -gt 0; do
        case "$1" in
        "-game")
            GAME="$2"
            shift ;;
        "-debug")
            DEBUG=1
            # Ensure that PID_FILE is set
            PID_FILE_SET=1
            if test -z "$PID_FILE"; then
                PID_FILE="hlds.$$.pid"
            fi ;;
        "-norestart")
            RESTART="" ;;
        "-pidfile")
            PID_FILE="$2"
            PID_FILE_SET=1
            shift ;;
        "-binary")
            HL="$2"
            HL_DETECT=0
            shift ;;
        "-timeout")
            TIMEOUT="$2"
            shift ;;
        "-gdb")
            GDB="$2"
            shift ;;
        "-debuglog")
            DEBUG_LOG="$2"
            shift ;;
        "-autoupdate")
            AUTO_UPDATE="yes"
            STEAM="./steam"
            RESTART="yes" ;;
        "-steamerr")
            STEAMERR=1 ;;
        "-ignoresigint")
            SIGINT_ACTION="" ;;
        "-notrap")
            NO_TRAP=1 ;;
        "-steamuser")
            STEAM_USER="$2";
            shift ;;
        "-steampass")
            STEAM_PASSWORD="$2";
            shift ;;
        "-help")
            # quit with syntax
            quit 2
            ;;
                                     esac

        shift
    done

    # Ensure we have a game specified
    if test -z "$GAME"; then
        echo "Unable to determine game type from command line."
        quit 1
    elif test ! -d "$GAME"; then
        echo "Invalid game type '$GAME' sepecified."
        quit 1
    fi

    if test 0 -eq "$NO_TRAP"; then
        # Set up the int handler
        # N.B. Dont use SIGINT symbolic value
        #  as its just INT under ksh
        trap "$SIGINT_ACTION" 2
    fi

    # Only detect the CPU if it hasnt been set with
    # either environment or command line
    if test "$HL_DETECT" -eq 1; then
        detectcpu
    fi

    if test ! -f "$HL"; then
        echo "Half-life binary '$HL' not found, exiting"
        quit 1
    elif test ! -x "$HL"; then
        # Could try chmod but dont know what we will be
        # chmoding so just fail.
        echo "Half-life binary '$HL' not executable, exiting"
        quit 1
    fi

    # Setup debugging
    if test -n "$DEBUG" ; then
        #turn on core dumps :) (if possible)
        echo "Enabling debug mode"
        if test "unlimited" != `ulimit -c` && test "`ulimit -c`" -eq 0 ; then
            ulimit -c 2000
        fi
        GDB_TEST=`$GDB -v`
        if test -z "$GDB_TEST"; then
            echo "Please install gdb first."
            echo "goto http://www.gnu.org/software/gdb/ "
            DEBUG="" # turn off debugging cause gdb isn't installed
        fi
    fi

    if test -n "$STEAM_PASSWORD" && test -z "$STEAM_USER"; then
        echo "You must set both the steam username and password."
        quit 1
    fi

    if test 1 -eq $PID_FILE_SET && test -n "$PID_FILE"; then
        HL_CMD="$HL $PARAMS -pidfile $PID_FILE"
    else
        HL_CMD="$HL $PARAMS"
    fi
}

syntax () {
    # Prints script syntax

    echo "Syntax:"
    echo "$0 [-game <game>] [-debug] [-norestart] [-pidfile]"
    echo "  [-binary [hlds_i486|hlds_i686|hlds_amd|hlds_amd64]"
    echo "  [-timeout <number>] [-gdb <gdb>] [-autoupdate]"
    echo "  [-steamerr] [-ignoresigint] [-steamuser <username>]"
    echo "  [-steampass <password>] [-debuglog <logname>]"
    echo "Params:"
    echo "-game <game>          Specifies the <game> to run."
    echo "-debug                Run debugging on failed servers if possible."

    echo "-debuglog <logname>   Log debug output to this file."
    echo "-norestart            Don't attempt to restart failed servers."
    echo "-pidfile <pidfile>    Use the specified <pidfile> to store the server pid."
    echo "-binary <binary>      Use the specified binary ( no auto detection )."
    echo "-timeout <number>     Sleep for <number> seconds before restarting"
    echo "          a failed server."
    echo "-gdb <gdb>            Use <dbg> as the debugger of failed servers."
    echo "-steamerr             Quit on steam update failure."
    echo "-steamuser <username> Use this username for steam updates."  
    echo "-steampass <password> Use this password for steam updates" 
    echo "          (-steamuser must be specified as well)."
    echo "-ignoresigint         Ignore signal INT ( prevents CTRL+C quitting"
    echo "          the script )."
    echo "-notrap               Don't use trap. This prevents automatic"
    echo "          removal of old lock files."
    echo ""
    echo "Note: All parameters specified as passed through to the server"
    echo "including any not listed."
}

debugcore () {
    # Debugs any core file if DEBUG is set and
    # the exitcode is none 0

    exitcode=$1

    if test $exitcode -ne 0; then
        if test -n "$DEBUG" ; then 
            echo "bt" > debug.cmds;
            echo "info locals" >> debug.cmds;
            echo "info sharedlibrary" >> debug.cmds
            echo "info frame" >> debug.cmds;  # works, but gives an error... must be last
            echo "----------------------------------------------" >> $DEBUG_LOG
            echo "CRASH: `date`" >> $DEBUG_LOG
            echo "Start Line: $HL_CMD" >> $DEBUG_LOG

            # check to see if a core was dumped
            if test -f core ; then
                CORE="core"
            elif test -f core.`cat $PID_FILE`; then
                CORE=core.`cat $PID_FILE`
            elif test -f "$HL.core" ; then
                CORE="$HL.core"
            fi
            
            if test -n "$CORE"; then
                $GDB $HL $CORE -x debug.cmds -batch >> $DEBUG_LOG
            fi
        
            echo "End of crash report" >> $DEBUG_LOG
            echo "----------------------------------------------" >> $DEBUG_LOG
            echo $CRASH_DEBUG_MSG
            rm debug.cmds
        else
            echo "Add \"-debug\" to the $0 command line to generate a debug.log to help with solving this problem"
        fi
    fi
}

detectcpu() {
    # Attempts to auto detect the CPU
    echo "Auto detecting CPU"

    if test -e /proc/cpuinfo; then
        CPU_VERSION="`grep "cpu family" /proc/cpuinfo | cut -f2 -d":" | tr -d " " | uniq`";
        if test $CPU_VERSION -lt 4; then
            echo "Error: hlds_l REQUIRES a 486 CPU or better";
            quit 1
    #   elif  test $CPU_VERSION -eq 15; then
    #       # P4 CPU version
    #       echo "Using Pentium II Optimised binary."
    #       HL=./hlds_i686
    #
        elif test $CPU_VERSION -ge 6; then
            AMD="`grep AMD /proc/cpuinfo`";
            if test -n "$AMD"; then
                OPTERON="`grep Opteron /proc/cpuinfo`";
                if test -z "$OPTERON"; then
                    OPTERON="`grep "Athlon HX" /proc/cpuinfo`";
                    if test -z "$OPTERON"; then
                        OPTERON="`grep "Athlon(tm) 64" /proc/cpuinfo`";
                    fi
                fi

                if test -n "$OPTERON"; then
                    echo "Using AMD-Opteron (64 bit) Optimised binary."
                    HL=./hlds_amd64
                else
                    echo "Using AMD Optimised binary."
                    HL=./hlds_amd
                fi
            else
                echo "Using Pentium II Optimised binary."

                # there is a CPU manufactured by VIA that
                # doesn't support some PII instructions...
                # detect this.
                VIACHIP=`grep CentaurHauls /proc/cpuinfo`
            
                if test -z "$VIACHIP"; then
                    HL=./hlds_i686
                fi
            fi      
        else
            echo "Using default binary."
        fi

    elif test "FreeBSD" = `uname`; then
        CPU="`grep 'CPU:' /var/run/dmesg.boot`"
        AMD="`echo $CPU |grep AMD`"
        I686="`echo $CPU |grep 686`"
        if test -n "$AMD"; then
            echo "Using AMD Optimised binary."
            HL=./hlds_amd
        elif test -n "$I686" ; then
            echo "Using Pentium II Optimised binary."
            HL=./hlds_i686
        else
            echo "Using default binary."
        fi
    else
        echo "Using default binary."
    fi
}

update() {
    updatesingle
}

updatesingle() {
    # Run the steam update
    # exits on failure if STEAMERR is set

    if test -n "$AUTO_UPDATE"; then
        if test -f "$STEAM"; then

            echo "Updating server using Steam."
            CMD="$STEAM -command update -game $GAME -dir ."; 
            if test -n "$STEAM_USER"; then
                CMD="$CMD -username $STEAM_USER";
            fi 
            if test -n "$STEAM_PASSWORD"; then
                CMD="$CMD -password $STEAM_PASSWORD";
            fi 

            $CMD
            if test $? -ne 0; then
                if test -n "$STEAMERR"; then
                    echo "`date`: Steam Update failed, exiting."
                    quit 1
                else
                    echo "`date`: Steam Update failed, ignoring."
                    return 0
                fi
            fi
        else
            if test -n "$STEAMERR"; then
                echo "Could not locate steam binary:$STEAM, exiting.";
                quit 1
            else
                echo "Could not locate steam binary:$STEAM, ignoring.";
                return 0
            fi
        fi
    fi

    return 1
}
    
run() {
    # Runs the steam update and server
    # Loops if RESTART is set
    # Debugs if server failure is detected
    # Note: if RESTART is not set then
    # 1. DEBUG is set then the server is NOT exec'd
    # 2. DEBUG is not set the the server is exec'd

    if test -n "$RESTART" ; then
        echo "Auto-restarting the server on crash"

        #loop forever
        while true
        do
            # Update if needed
            update

            # Run the server
            $HL_CMD
            retval=$?
            if test $retval -eq 0 && test -z "$AUTO_UPDATE"; then
                break; # if 0 is returned then just quit
            fi

            debugcore $retval

            echo "`date`: Server restart in $TIMEOUT seconds"

            # don't thrash the hard disk if the server dies, wait a little
            sleep $TIMEOUT
        done # while true 
    else
        # Update if needed
        update

        # Run the server
        if test -z "$DEBUG"; then
            # debug not requested we can exec
            exec $HL_CMD
        else
            # debug requested we can't exec
            $HL_CMD
            debugcore $?
        fi
    fi
}

quit() {
    # Exits with the give error code, 1
    # if none specified.
    # exit code 2 also prints syntax
    exitcode="$1"

    # default to failure
    if test -z "$exitcode"; then
        exitcode=1
    fi

    case "$exitcode" in
    0)
        echo "`date`: Server Quit" ;;
    2)
        syntax ;;
    *)
        echo "`date`: Server Failed" ;;
    esac

    # Remove pid file
    if test -n "$PID_FILE" && test -f "$PID_FILE" ; then
        # The specified pid file
        rm -f $PID_FILE
    fi

    # reset SIGINT and then kill ourselves properly
    trap - 2
    kill -2 $$
}

# Initialise
init $*

# Run
run

# Quit normally
quit 0

  • TrailBlazer
  • Registratie: Oktober 2000
  • Laatst online: 07-02 09:48

TrailBlazer

Karnemelk FTW

er zit een spatie tussen het uitroepteken en de slash haal die eens weg. Het probleem is dat de interpreter voor het script niet gevonden kan worden. Spatie zou niks uit mogen maken maar sluit het even uit. Je hebt geen ssh toegang op die server?

[ Voor 56% gewijzigd door TrailBlazer op 25-07-2005 15:21 ]


Verwijderd

Topicstarter
Haalt niets uit :| Kan het te maken hebben met het start bestand? Er is namelijk een bestand die het ip, port, first map en alles aangeeft..... Ik plak hem hieronder:

code:
1
2
3
4
#!/bin/sh
screen -r k**** -X quit
echo Server has been restarted
screen -dmS k****  ./hlds_run -autoupdate -game cstrike +ip 193.138.205.32 +maxplayers 8 -port 27018 +exec server.cfg +map de_dust2

*de **** is in plaats van mijn persoonlijke login*

Ik weet niet een wat SSH is, dus ik denk idd dat ik geen toegang heb :/

[ Voor 9% gewijzigd door Verwijderd op 25-07-2005 15:25 ]


  • MikeN
  • Registratie: April 2001
  • Laatst online: 09-02 20:34
ItsHosted heeft geen eigen support afdeling?
De hlds_run kun je wel herstellen door weer een steam update te draaien, als je dat niet zelf kan misschien ook even met ItsHosted contact opnemen ;)

  • DeMoN
  • Registratie: Maart 2001
  • Laatst online: 06-01 23:13

DeMoN

Pastafari

Verwijderd schreef op maandag 25 juli 2005 @ 15:24:
Haalt niets uit :| Kan het te maken hebben met het start bestand? Er is namelijk een bestand die het ip, port, first map en alles aangeeft..... Ik plak hem hieronder:

code:
1
2
3
4
#!/bin/sh
screen -r k**** -X quit
echo Server has been restarted
screen -dmS k****  ./hlds_run -autoupdate -game cstrike +ip 193.138.205.32 +maxplayers 8 -port 27018 +exec server.cfg +map de_dust2

*de **** is in plaats van mijn persoonlijke login*

Ik weet niet een wat SSH is, dus ik denk idd dat ik geen toegang heb :/
Hoe pas jij die scripts op de webspace van jouw hoster aan als je niet met SSH kan werken?
FTP?
Maak eens een bestand aan met als inhoud dit:
code:
1
2
#!/bin/bash
which sh


En geef ons eens de output :)

Gamertag: Cosmicv0id
"Het woord Gods is voor mij niets meer dan een expressie en het product van menselijke zwakheid. De Bijbel is een verzamelwerk van legendes die achtenswaardig zijn maar ook primitief en kinderachtig.'' - Albert Einstein


Verwijderd

Topicstarter
Ik heb toegang via FTP. Ik heb het bestand gemaakt en geupload naar mijn server. ik weet alleen niet hoe ik de output krijg :? Srry, ben niej sow slim 8)7 ...... Ik weet niej hoe ik het moet draaien op die server?

[ Voor 14% gewijzigd door Verwijderd op 25-07-2005 17:30 ]


  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

ik denk dat je beter even een basiscursus linux kunt gaan halen voor je dit soort dingen gaat doen ;)

Zaram module kopen voor je glasvezelaansluiting?


Verwijderd

Topicstarter
Vertel me alleen waarmee en hoe ik op een FTP server zo'n bestand kan laten draaien, zodat ie iets doet...

  • deadinspace
  • Registratie: Juni 2001
  • Laatst online: 21:52

deadinspace

The what goes where now?

Je hebt die file op een Windows bak gemaakt, en nu bevat hij windows newlines (\r\n) ipv UNIX newlines (\n). De shell /bin/sh\r bestaat niet, dus die vindt hij niet.

Zet de file op je server om naar UNIX newlines (zoek: dos2unix), of zet hem op je Windows bak om en upload hem opnieuw.
Pagina: 1