Accessing the shell
On a SONiC switch the Broadcom diag shell runs inside syncd. You reach it
from the host with bcmsh for an interactive session, or with
bcmcmd to run one command from a script. Both give you the
drivshell> prompt, a thin SAI front-end in front of the SDK command
interpreter.
How the pieces fit together
flowchart TB
subgraph host["Host"]
hbcmsh["bcmsh"]
hbcmcmd["bcmcmd"]
end
subgraph syncd["syncd container"]
cbcmsh["bcmsh<br/>(socat, readline)"]
cbcmcmd["bcmcmd<br/>(C++ client)"]
sock[("/var/run/sswsyncd/<br/>sswsyncd.socket")]
dsserve["dsserve<br/>one client at a time,<br/>socket ⇄ pseudo-terminal"]
subgraph proc["syncd --diag"]
thread["diag-shell thread<br/>enables the shell, again every 1 s"]
fe["SAI front-end<br/>prompt drivshell>"]
sdk["SDK command interpreter<br/>unit 0"]
end
end
hbcmsh -- "docker exec -it" --> cbcmsh
hbcmcmd -- "docker exec -i" --> cbcmcmd
cbcmsh --> sock
cbcmcmd --> sock
sock --> dsserve
dsserve -- "pty: stdin, stdout, stderr" --> proc
thread --> fe --> sdk
From the user inward:
Host commands
/usr/bin/bcmshand/usr/bin/bcmcmd. Each runsdocker execinto thesyncdcontainer and calls the container’s command of the same name.Container clients.
bcmshis a bash script that runssocat.bcmcmdis a small C++ program.dsserve, a UNIX-socket-to-pseudo-terminal proxy. supervisord starts
syncdthrough it, sosyncd’s standard input, output and error all go through one pseudo-terminal, and that terminal is exposed on the socket/var/run/sswsyncd/sswsyncd.socket.syncd, started with
--diag. Once the switch is created, a thread asks the SAI to enable the switch shell. That call blocks for as long as the shell runs.The SAI front-end, which prints the
drivshell>prompt. It handles a few keywords itself and passes every other line to the SDK command interpreter, always on unit 0.
How syncd starts the shell server
The syncd start-up scripts run syncd under dsserve:
CMD_DSSERVE=/usr/bin/dsserve
CMD_DSSERVE_ARGS="$CMD_SYNCD --diag"
if [ -x $CMD_DSSERVE ]; then CMD=$CMD_DSSERVE; CMD_ARGS=$CMD_DSSERVE_ARGS; …
exec ${CMD} ${CMD_ARGS} # dsserve /usr/bin/syncd --diag -u -p … …
dsserveruns in the foreground and listens on its default socket,/var/run/sswsyncd/sswsyncd.socket.It creates a pseudo-terminal, connects
syncd’s standard input, output and error to it, and startssyncd. It accepts one client at a time.Inside
syncd, a thread enables the switch shell once a second. While a shell session is active the call blocks; when the shell exits, the thread enables it again a second later. The loop ends only if enabling the shell fails.Each time the shell is enabled it prints
Hit enter to get drivshell prompt..and waits for a newline. Only one shell can be active at a time.
When no client is connected, syncd’s console output, including the Hit
enter… banner and any SDK messages, goes to /var/log/syslog. While a
client is connected, all of it goes to that client instead, including SDK log
lines unrelated to the command you ran.
Note
The SAI also opens the shell during switch initialisation if an SDK init
command fails and the config.bcm property sai_suspend_on_error is
non-zero. It prints SDK init failure. Use diag commands to
troubleshoot. and opens the same drivshell> prompt before switch
creation has finished. Connect with bcmsh to investigate, and type
quit to let initialisation continue.
Host commands
- bcmsh [-n ASIC] [-h] [-q] [-t SECONDS]
Open an interactive session with the diag shell.
-n ASICConnect to
syncd<ASIC>. Accepted only on multi-ASIC platforms; Trident 3 systems are single-ASIC.-qDo not print the banner.
-t SECONDSClose the session after this many seconds without traffic. The default is 300;
0turns the timeout off.-hPrint usage.
Unless
-qis given,bcmshprints:Press Enter to show prompt. Press Ctrl+C to exit. NOTICE: Only one bcmsh or bcmcmd can connect to the shell at same time.
Line editing and up-arrow history work locally: the line is sent to the switch only when you press Enter. Ctrl-C closes the session but does not interrupt a command that is already running inside
syncd(see Interrupting commands).Unvalidated
$ bcmsh Press Enter to show prompt. Press Ctrl+C to exit. NOTICE: Only one bcmsh or bcmcmd can connect to the shell at same time. Enter 'quit' to exit the application. drivshell>ps ... drivshell>
- bcmcmd [-n ASIC] [-v] [-t SECONDS] [-f SOCKET] COMMAND
Run one diag-shell command line and print its output.
bcmcmddoes not need a terminal, so it can be used in pipelines and scripts.COMMANDOne argument. Quote multi-word commands:
bcmcmd "l2 show". If several bare words are given, only the last one is run.-n ASICConnect to
syncd<ASIC>on multi-ASIC platforms.-t SECONDSHow long to wait for output before giving up. The default is 30.
-f SOCKETSocket path. The default is
/var/run/sswsyncd/sswsyncd.socket.-vPrint
[INFO] cmd: …and[INFO] domain socket filename: …for the options that follow it.-h,--helpPrint usage and exit with status 22.
-tand-fmust be followed by at least one more argument after their value:bcmcmd -t 5alone is rejected with[ERROR] bad timeout(exit 22), butbcmcmd -t 5 psworks.Exit status:
Code
Meaning
0
The shell returned to the
drivshell>prompt. This does not mean the diag command succeeded; see Errors and result codes.1
Could not connect to or write to the socket (for example
connecting stream socket).5
Read error, or the server closed the connection (
ending connection).22
Usage error, or
-h.62
No prompt arrived within the timeout (
polling socket timeout).How bcmcmd talks to the shell.
bcmcmdconnects, sends a newline and silently waits for either theHit enter to get drivshell prompt..banner (answering it with another newline) ordrivshell>. It then sendsCOMMANDfollowed by a newline and prints everything it receives until the output ends indrivshell>again. There is no framing or end-of-output marker; the prompt text is the only delimiter. This has some consequences:The output starts with the shell’s echo of
COMMANDand ends withdrivshell>. Parsers should drop the first and last lines. The text comes from a terminal, so lines end in\r\n(the echoed command line in\r\r\n).A command that does not return to
drivshell>makesbcmcmdwait until the timeout and exit with 62. The command keeps running insyncd, and the shell may be left in another mode. Examples:cintwith no arguments, which leaves the shell atcint>;pause, which waits for a key;quit, after which the shell shows theHit enter…banner, notdrivshell>;any command that runs longer than
-tseconds without the output ending in the prompt.
If a command’s own output happens to end in the text
drivshell>at the end of a read,bcmcmdstops early.Only one client is served at a time. A second
bcmcmdconnects but gets no data until the first one disconnects, so it usually times out with exit 62.When
bcmcmdgives up, the command does not stop. It keeps running insidesyncd, and until it finishes no otherbcmcmdorbcmshgets the shell.techsupport all, for example, runs for more than ten minutes. Give long commands a generous-t.
Hardware-validated
$ bcmcmd "echo hello world" echo hello world hello world drivshell>
Hardware-validated
$ bcmcmd -t 60 "echo one; echo two" echo one; echo two one two drivshell>
Other network operating systems
Most switches built on Broadcom StrataXGS chips run the same SDK and the same diag shell, but each operating system hides it behind its own command. The shell commands are the same; the SDK release, and with it the available commands and output formats, can differ from SONiC’s. On every one of these systems the switch software does not know about changes you make in the shell, so stick to reading state unless the vendor’s support asks otherwise.
Arista EOS
platform trident diag <command> runs one diag-shell command and prints
its output. It needs privileged mode (enable); otherwise EOS answers
% Invalid input (privileged mode required). Quoting the command is
optional. There is no interactive prompt; run one command per line.
switch>enable
switch#platform trident diag ps xe8
ena/ speed/ link auto STP lrn inter max loop
port link duplex scan neg? state pause discrd ops face frame back
xe8( 9) up 10G FD HW No Forward None F SFI 9232
switch#platform trident diag ver
Broadcom Command Monitor: Copyright (c) 1998-2010 Broadcom Corporation
Release: sdk-6.4.12 built 20230526 (Fri May 26 03:40:50 2023)
...
EOS uses its own port names (Ethernet7/1); the shell uses the SDK’s
(xe8). show platform trident interface map lists both side by side.
Cisco NX-OS
On Nexus 3000 and 9000 switches with Broadcom chips (NX-OS 7.x and later),
bcm-shell module <module> opens an interactive shell with the prompt
bcm-shell.<unit>>, after a warning that the shell should be used with
caution. exit leaves it. Typing a unit number at the prompt switches to
another chip of the same module.
switch# bcm-shell module 1
bcm-shell.0> l2 show
bcm-shell.0> exit
To run a single command, give it in quotes after the module, optionally with a
unit prefix: bcm-shell module 1 "0:ps". Single commands are recorded in
the system accounting log and can be piped through NX-OS filters such as
| include; commands typed in the interactive shell are not logged.
NX-OS 6.x and modular chassis use the older form, from the module’s own shell:
switch# attach module 2
module-2# test hardware internal bcm-usd bcm-diag-shell
bcm-shell.0> exit
module-2# exit
Cisco recommends against changing chip settings this way and expects these commands to be used under the guidance of Cisco support.
Juniper Junos (QFX5100, QFX5110)
From the Junos shell, vty fpc0 opens the line-card console; there each
diag-shell command is wrapped in set dcbcm bcmshell "<command>". As root,
cprod runs one such command without the console:
FPC0(vty)# set dcbcm bcmshell "ps"
root@switch:~ # cprod -A fpc0 -c 'set dcbcm bcmshell "listmem"'
Cumulus Linux
Older Cumulus Linux releases (2.x–3.x) ship /usr/lib/cumulus/bcmcmd,
which runs one command at a time: sudo /usr/lib/cumulus/bcmcmd ps.
Cumulus warns that opening the shell interactively can disrupt switchd
and forwarding.
Extreme EXOS
After enable debug-mode (which asks for a debug password), the shell is
/extr/bin/bcm.shell; pick a unit with 0: and leave with quit.
The drivshell> front-end
Entry. When the shell starts it waits for a newline (the
Hit enterbanner), then printsEnter 'quit' to exit the application.Prompt. The prompt is
drivshell>, with no trailing space and no unit number. Input lines are limited to 1024 characters; longer lines are truncated withWARNING: input line truncated to %d chars.Front-end keywords. A few lines are handled by the front-end itself before the SDK sees them. The check is made on the raw line:
Line
Effect
quitPrints
Exiting the application.and leaves the shell. Must be exactlyquit, lower case, with nothing else on the line;QUITorquitwith trailing text goes to the SDK instead.bsvPrints the SAI and SDK versions; see
bsv.phydumpSAI PHY dump; see
phydump.xled ARGS…SAI LED helper; see
xled ARGS.sh(any case)Refused with
Command sh is blocked; see Blocked commands.she…(any case)Refused: any line starting with
she.reb…(any case)Refused: any line starting with
reb.Everything else goes to the SDK command interpreter, always on unit 0. Commands run one at a time. If the SAI has not enabled diag commands yet, every line fails with Feature unavailable.
- phydump
Run the SAI PHY dump. This is a front-end keyword, not an SDK command, and must be the whole line. It does nothing unless the SAI’s PHY-dump feature is enabled. On a SONiC Trident 3 switch it is enabled and prints, for every front-panel port, a
# <port> (logical=<n>, physical=<n>)heading, the port’s PHY control settings (pre-emphasis, DFE, link training, interface, FEC clauses) and the SerDes core and per-lane configuration. With 36 ports that is over 5,000 lines. Read-only.Hardware-validated
drivshell> phydump ##################################################### # ce0 (logical=1, physical=1) ##################################################### Current PHY control settings of ce0 -> Preemphasis = 0x164608 DriverCurrent = 0xffffffff DFE ENable = True LP DFE ENable = False BR DFE ENable = False LinkTraining Enable = False Interface = 0xe CL74 = False CL91 = False CL108 = False tscf16_phy_pmd_info_dump:539 type = 4096 laneMask = 0xF, Address = 0x81 tscf16_phy_pmd_info_dump:608 type = CFG *********************************** **** SERDES CORE CONFIGURATION **** *********************************** uC Config VCO Rate = 180 (~25.750GHz) Core Config from PCS = 0 Tx Lane Addr 0 = 3 Rx Lane Addr 0 = 0 ...
- xled ARGS
The SAI’s LED-processor helper. This is a front-end keyword, not an SDK command; it is recognised when
xledis the first word of the line, and up to 128 words are passed to it.Unvalidated
drivshell>xled
Blocked commands
The front-end refuses a few lines to protect syncd: the bare sh and
anything starting with she (the SDK’s shell command, which would run
Linux commands inside the syncd container) and anything starting with reb
(reboot, which would stop the SDK and with it syncd). The refused line
never reaches the SDK.
Warning
This block list only checks the start of the raw line. The same dangerous SDK commands can still be reached in other ways:
resetis an alias ofreboot. It makes syncd exit, which restarts the switch dataplane.exit cleanfrees the SDK’s resources for all attached units; this is what the SAI itself does at shutdown.sh CMDis not blocked; only the bare lineshis. It runsCMDas a shell command, as root, inside the syncd container.Text after
;, after leading spaces, or after a unit prefix such as0:is never checked against the block list.
Do not run these on a production switch.
Leaving the shell
quit(exactly) leaves thedrivshell>prompt but does not stopsyncd. About a second later the shell is enabled again: a connected client seesHit enter to get drivshell prompt.., and pressing Enter bringsdrivshell>back.exitandQUITdo nothing.exit cleanis not harmless; see the warning above.Disconnecting (Ctrl-C in
bcmsh, orbcmcmdfinishing) leaves the shell atdrivshell>, ready for the next client.
Shell modes and prompts
Prompt |
How you get there |
How you leave / notes |
|---|---|---|
|
The shell has just been (re-)started by |
Press Enter. This is not a real prompt; the shell is only waiting for a newline. |
|
The default. |
|
|
|
|
|
A diagnostic test failed under the test framework. Prints |
|
|
Continuation prompt after a line ending in |
— |
The classic SDK prompt BCM.0>, shown in Broadcom documentation, cannot be
reached on SONiC. There are no other mode prompts. The mode command
switches the SDK’s command set between ESW, LTSW and CTSW; Trident 3 is ESW
only, and the prompt does not change either way.
Differences from the classic BCM.0> shell
These classic-shell features are not available in drivshell>:
!!and!$history substitution;N:orN::on its own to change the default unit. Indrivshell>the unit is always 0, andN:alone does nothing;\line continuation,~to leave, andType "EXIT" to exit shellon end of input;the user-defined
$promptvariable and the.debugprompt suffix;Ctrl-C to interrupt a command (see Interrupting commands).
Everything else works as usual: ; chaining, quoting, variables, unit
prefixes on individual commands, ? usage, rc scripts and the control
commands.
Command-line syntax
Words and quoting
Words are separated by white space.
"…"and'…'group words; the quote characters are removed. Quotes can start in the middle of a word:a"b c"dis one word,ab cd. A line that ends inside a quote fails withERROR: Command line ended while in a quoted string.\xmakesxliteral everywhere, including inside quotes. A\at the end of a line fails withERROR: Can't escape EOL.A statement can have at most 1024 words and 8192 bytes.
Chaining with ;
;outside quotes ends a statement; the rest of the line runs next.Statements run left to right even if an earlier one fails. The line stops early only on a usage error, an exit, or an interrupt.
The result of the line, and the
Failed to execute…message, reflect the last statement that ran.$?is updated after each statement.
Hardware-validated
drivshell> echo "a b" 'c;d' e\;f; echo second
a b c;d e;f
second
Variables
Expansion.
$nameand${name}are replaced with the variable’s value;@nameis a deprecated synonym. Names consist of letters, digits,_and?. Variables are expanded inside double quotes but not inside single quotes. An undefined variable expands to nothing.$?nameexpands to1ifnameis defined and0if not.SDK and config variables. If a name is not a shell variable, the SDK may also resolve it:
$feature_NAMEgives1if the chip has SOC featureNAME;any other name gives the value of the
config.bcmproperty of that name, e.g.$portmap_1.
Scopes.
localNAME [VALUE]sets a variable in the current scope.drivshell>itself has no local scope, so at the promptlocalsets a global variable.setenvNAME [VALUE]sets a global (exported) variable. With no value it removes the variable.printenv[local|global|all]lists variables.Names beginning with
_are system variables. They can be read but not set.Each
rcloadruns in its own scope, with$1,$2, … set from its arguments.Variables set at the prompt stay set across
bcmcmdcalls andbcmshsessions until they are removed orsyncdrestarts. Eachbcmcmdcall sees what earlier calls left behind.
Built-in variables.
$?holds the numeric result of the last statement: 0 OK, −1 fail, −2 usage, −3 not found, −4 exit, −5 interrupted. It does not survive from onebcmcmdcall to the next (it reads 0 there), so use it on the same line:expr 1 + 2; echo $?.For each unit the shell sets
devname,ldevname,pcidev,pcirev,fw_prefix,unit<N>(=1), and the chip and device names as flags (=1).
Arithmetic.
exprEXPRESSIONevaluates a C-style integer expression and returns the value as the command result, usable inif.
Hardware-validated
drivshell> local port 5
drivshell> echo port is $port, quoted '$port', defined $?port
port is 5, quoted $port, defined 1
Command names and lookup
Matching. Command names are matched case-insensitively. In a command name such as
PortStat, the upper-case letters are required and the lower-case ones optional:portstat,psandPSall work, andRCLoadacceptsrclorrcload. If more than one command matches, the first wins, unless a later command’s full name is a prefix of what was typed.Lookup order.
commands added at runtime for the unit (such as
BCMSAI);the shell built-ins (80 commands);
the chip’s own commands (ESW on Trident 3).
Because the built-ins come first,
shrunsSHell, not aSHOW-family command.Integers as conditions. A statement that is just an integer succeeds if it is non-zero and fails if it is zero.
ifrelies on this.Excess arguments. If a command succeeds but did not use all its arguments, the shell prints
CMD: WARNING: excess arguments ignored beginning with 'X'.
Unit prefixes
A statement can be prefixed with a unit specification. It then runs once per listed unit, with that unit’s variables in effect:
N:CMDUnit N (one or two digits).
N-M:CMDUnits N to M.
N,M,…:CMDA list; ranges are allowed in it.
*:CMDAll attached units.
Errors are Error: Bad unit specification and Error: Unit N is not
attached. White space after the : is allowed. On single-ASIC Trident 3
only 0: and *: are useful. In drivshell> a bare N: does
not change the default unit.
Help
CMD ?orCMD help, as the only argument, printsUsage (CMD): …with the command’s built-in usage text. The SoC propertyhelp_cli_enable=0turns this off.?lists all commands in a compact format.help(also??) with no arguments lists commands with one-line descriptions;help CMD …prints usage for each command named.A usage error is not reported as a failure in
drivshell>, sobcmcmdexits 0.
Errors and result codes
The SDK prints its own messages, e.g. Unknown command: foo. The
drivshell> front-end then adds one line, depending on the result:
SDK result |
Mapped to |
Extra line printed by |
|---|---|---|
OK, |
0 |
— |
USAGE (−2) |
0 |
— (usage text already printed) |
EXIT (−4), INTR (−5) |
0 |
— |
NFND (−3) |
−7 |
|
FAIL (−1) / other |
−11 |
|
NOTIMPL (−6) |
−16 |
|
diag disabled / busy |
−16 |
|
None of these change bcmcmd’s exit status. Scripts must look for these
strings in the output. The extra line comes after the SDK’s own message,
separated by a blank line, for example when log off finds
nothing to stop:
drivshell> log off
File logging is not active.
Failed to execute the diagnostic command. Error: Operation failed.
Throughout this reference, when a command is said to fail, this is the line you see.
Unknown commands and rc fall-back
When a word is not a known command, the shell tries to run a script called
WORD.soc, as if you had typed rcload WORD.soc. It looks for the file
in each directory of $path, or in syncd’s current directory if
path is not set. On SONiC path is . / and syncd’s working
directory is /, so both entries mean the container’s root directory. The remaining words become $1…. Only if that also
fails is Unknown command: WORD printed. Turn this off with set
RCLoad=off.
Control commands
These are SDK shell built-ins; the usage text below is quoted from the
built-in help. Each command argument is one complete command line, so quote
any that contain spaces, and use single quotes to stop $var being
expanded too early.
loopCOUNT|* "CMD" …Runs the commands
COUNTtimes, or forever with*. It stops on the first failure whileLoopErroris on (the default).loop 10 "echo hello world".forVAR=START,STOP[,STEP[,FMT]] 'CMD' …for port=0,23 'echo port=$port'.FMTis a printf format; the default is%d.ifCOND ["CMD" … [else "CMD" …]]CONDis an integer or a command line;&&,||and!are evaluated left to right.if $?quickturn && !"bist arl" "echo BIST failed".IFError(default on) stops after the first failing command.caseWHAT VALUE "CMD" [VALUE "CMD"]…Runs the command whose
VALUEmatchesWHAT.exprEXPRESSIONC-style integer arithmetic; the value becomes the command result.
echo[-n] TEXT…/noechoTEXT…Print the words joined by single spaces;
-nleaves out the newline.noechoignores its arguments.time["CMD" …]Times the commands, e.g.
time "sleep 1" "sleep 2". With no argument it prints the current time.sleep[quiet] [SECONDS [USEC]]/delayUSECSuspend the shell, or busy-wait for
USECmicroseconds.pause[-x] TEXT…Waits for SPACE (or
xwith-x) orQ. Underbcmcmdthere is no way to answer, so it waits until the timeout.background"CMD",jobs,killNRun a command in the background, list background jobs, or kill one.
Hardware-validated
drivshell> for p=1,3 'echo port $p'
port 1
port 2
port 3
Hardware-validated
drivshell> loop 2 "echo hello world"
hello world
hello world
Shell options (set)
set with no arguments shows the options, and set OPTION=VALUE
changes one. set = prompts for each option in turn, which makes
bcmcmd wait until its timeout.
Option |
Default |
Effect |
|---|---|---|
|
on |
Errors terminate an |
|
on |
Errors stop |
|
on |
rcload scripts abort on a failing command. |
|
off |
If on, rcload does not print the per-line error. |
|
on |
Unknown command → try |
|
on |
|
|
20 |
Lines per page for |
|
5 |
Seconds between progress reports of long tests. |
rc scripts
rcloadFILE [ARGS…]Runs commands from
FILEline by line.ARGSbecome$1,$2, … in a new local scope.FILEmust exist inside the syncd container.A trailing
\joins the next line,#starts a comment, and\ris removed.A failing line prints
Error: file F: line N (error code E): script terminatedor… script continuing, depending onRCError. Lines starting withexprnever count as failures.A file with no lines prints
Error: file F: empty script.Nesting too deeply prints
rcload: recursion too deep.
A path containing
/is opened directly. Otherwise the file is looked up in therccache, then in$path.rccacheshow [NAME] | add NAME | addq NAME | update NAME | delete NAME | clearKeeps rc files in memory so that later
rcload NAMEcalls do not read the file system.
The SAI itself runs reload.soc and rc.soc scripts in some situations.
config.bcm handling is covered in Configuration variables.
Hardware-validated
drivshell> rcload /tmp/show-ports.soc ce0
ena/ speed/ link auto STP lrn inter max cut loop
port link Lns duplex scan neg? state pause discrd ops face frame thru? back encap
ce0( 1) !ena 4 100G FD SW No Forward Untag F CR4 9122 No IEEE
Line editing, history and output
Echo. The shell echoes your input itself. That echo is why
bcmcmdoutput starts with the command line.History.
history[COUNT]lists the shell’s history, butdrivshell>lines are not recorded in it, so it prints nothing. Inbcmsh, up-arrow history works locally.Paging. Command output is not paged. Only
moreFILEpages, andpausewaits, usingMoreLineslines per page.Console and log.
consoleon|offturns console output on and off.logfile=F [append=yes|no] [quiet=yes|no] [on|off]copies output to a file inside the container.
Files inside the syncd container
The shell’s file commands (ls, copy, save,
log, rcload, rm …) work on the file system of
the syncd container, as root. /tmp there is a tmpfs of its own,
mounted noexec: the shell can write and read files in it, but nothing in
it can be executed.
To give the shell a file from the host, such as an rc script or a
Cint program, copy it to /root in the container
and use the absolute path:
sudo docker cp watch.soc syncd:/root/
bcmcmd "rcload /root/watch.soc ce0"
Do not copy into /tmp or /var/tmp: both are separate in-memory
file systems inside the container, and docker cp into them reports
success but the file never appears there. Files the shell itself writes to
/tmp (for example with log) can be read back through the
container:
sudo docker exec syncd cat /tmp/bcm-diag.log > bcm-diag.log
Interrupting commands
drivshell> has no way to interrupt a running command. Ctrl-C in
bcmsh closes your session, but the command keeps running inside
syncd, and its output goes to syslog. Sending a raw Ctrl-C byte over the
socket is not expected to stop it either.
Do not start loop * or other unbounded commands in
drivshell>. The only way to stop them is to restart syncd.
Comments
There is no comment character on the interactive command line. A line starting with
#is looked up as a command called#(see Unknown commands and rc fall-back).Use
noecho(Parameters: <Any text> Ignore whatever follows on command line) as a comment that is safe interactively.In rc scripts loaded with
rcload, everything from the first#to the end of the line is removed, even inside quotes.