If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.

0
U

Property:pcd (chipcmd)

From BoxMatrix


BoxMatrix >> Shell-Commands >> pcd (chipcmd) @ BoxMatrix   -   IRC-Chat   -   Translate: de es fr it nl pl
News Selectors Models Accessories Components Environment Config Commands System Webif Software Develop Lexicon Community Project Media

Startup-Scr Hotplug-Scr BusyBox-Cmds Bash-Cmds AVM-Cmds Chipset-Cmds Linux-Cmds Shared-Libs Kernel-Mods Research

Info
  
Name-Collision - multiple objects in this wiki use the name pcd!
pcd (chipcmd) Process Control Daemon, a supervisor alike service manager daemon.
pcd (process) Process Control Daemon, a supervisor alike service manager daemon.

Chipset-Command

Goto:   Rules  -  API  -  Examples  -  GPL-Browser  -  Dependencies   -   Model-Matrix   -   Symbols   -   SMW-Browser

Details

pcd is the Process Control Daemon, a supervisor alike service manager daemon designed to speed up system boot time.

It was developed for TI and used in all cable models, always running on the ARM side which contains the DOCSIS stack.
Initially proprietary TI decided to release the source (LGPL v2.1) and documentation (CC BY SA) on SourceForge.

On SourceForge there are the revisions 0.0.1 r1 (2010) to r32 (2012), and the release versions 1.0.8 (2011) to 1.1.6 (2014).
On Github there are the tags 1.1.6 (2014) to 1.2.2 (2017) and the current working copy.

The first cable model by AVM was the Puma5 based 6360 introduced in 2010.

Excerpt from the PCD homepage on Github:

PCD (Process Control Daemon), is an open source, light-weight, system level process manager 
for Embedded Linux based products (Consumer electronics, network devices, and more). With PCD 
in control, it is guaranteed that the system’s boot up time will be reduced, and its reliability,
availability and robustness will be enhanced.

Fw 7.57 help:

Usage: pcd [options]

Options:
-f FILE, --file=FILE            Specify PCD rules file.
-p, --print                     Print parsed configuration.
-v, --verbose                   Verbose display.
-t tick, --timer-tick=tick      Setup timer ticks in ms (default 200ms).
-e FILE, --errlog=FILE          Specify error log file (in nvram).
-h, --help                      Print this message and exit.

There is one option not listed in the help: See the Examples how it's used.

-d, --debug                     Debug mode. Do not reboot if pcd terminates.

Version 0.0.5 r19 adds another option not listed in the help:

-V, --version                   Print the pcd version.

Version 1.1.0 adds:

-c, --crashd                    Enable crash-daemon only mode (no rules file).

Since the getopts options used in FRITZ!OS are dpvhf:t:e: it must be a branch older than version 0.0.5 r19.
You can browse versions 0.0.5 r18 and 1.0.8 on the GPL-Browser below, but they do not contain the changes for FRITZ!OS.
But these changes seem to be minor, just the API explained below is linked from libticc.so.

Rules

pcd is configured by rule files also called scripts, *.pcd text files located in /etc/scripts.
Their purpose is similar to the *.service files of supervisor., but they cover multiple services and are more advanced.

Excerpt from the PCD Scripts documentation:

The PCD script, or Rule file is the actual input to the PCD. The script file is a human readable
text file, and it is composed of “Rule Blocks”. Each Rule block defines which process to start, 
when to start it, in which priority to run it, what recovery action to take when it fails, and 
more. A rule block is associated with a single process. The Rule Blocks have a uniform structure 
and composed of a set of commands, according to the following syntax, where lines that start with 
a # mark are remark lines which the PCD ignores.

This is a subset of the Static-Configuration section, filtered for *.pcd rule files:

Daily updated index of all pcd rules found scanning Firmware-Probes . Last update: 2024-05-26 05:52 GMT.
The label (static) in the Rule column shows there are other objects in this wiki using this name.
The Mod column shows the amount of models using the respective rule. Click the column header to sort by this number.
You can hover or click a possible Link in the Type column to see the target of that link.

API

pcd does not have a specific control command like svctl for supervisor but provides an API.
This API can be compiled into an executable and provides functions similar to libsvctl.so.
See the PCD API source.

Excerpt from the PCD API documentation:

The PCD provides additional API for every application in order to request services from the PCD, 
or retrieve information. The services that the PCD provides encapsulate the actual process name 
and id (pid might vary). The controlling application only needs to know the rule name in order 
to request a service.

In FRITZ!OS PCD API is compiled into libticc.so, which is used by the entire DOCSIS stack.

All daemons started by pcd rule files use PCD_api_send_process_ready to notify pcd about being started successful.

To find executables which use the API just grep for PCD_api_. 6490 fw 7.29 PCD API usage:

Examples

Simplified pcd startup from pacm_setup.sh fw 7.29:

killall watchdog_rt
pcd -f /etc/scripts/vsdk.pcd -p -t 20 -e /nvram/pcd_error_log.txt &  

pcd will reboot the system if it is terminated unless CONFIG_DOCSIS_PCD_NO_REBOOT is y which adds the -d option.

Full quote of the example rule file from the system.pcd source:

#################################################################
# system.pcd: Example PCD script for system services startup
#
#################################################################
RULE = SYSTEM_WATCHDOG
START_COND = NONE
COMMAND = /usr/sbin/watchdog -t 10 /dev/watchdog -n
SCHED = FIFO,99
DAEMON = YES
END_COND = NONE
END_COND_TIMEOUT = -1
FAILURE_ACTION = RESTART
ACTIVE = YES

#################################################################
RULE = SYSTEM_LOGGER
START_COND = NONE
COMMAND = /usr/sbin/logger --no-fork
SCHED = NICE,19
DAEMON = YES
END_COND = PROCESS_READY
END_COND_TIMEOUT = -1
FAILURE_ACTION = RESTART
ACTIVE = YES

#################################################################
RULE = SYSTEM_TIMER
START_COND = RULE_COMPLETED,SYSTEM_LOGGER
COMMAND = /usr/sbin/timer --timer-tick=100
SCHED = FIFO,1
DAEMON = YES
END_COND = PROCESS_READY
END_COND_TIMEOUT = -1
FAILURE_ACTION = RESTART
ACTIVE = YES

#################################################################
RULE = SYSTEM_INIT
START_COND = NONE
COMMAND = /usr/sbin/sys_init
SCHED = NICE,3
DAEMON = NO
END_COND = PROCESS_READY
END_COND_TIMEOUT = -1
FAILURE_ACTION = RESTART
ACTIVE = YES

#################################################################
RULE = SYSTEM_LASTRULE
START_COND = RULE_COMPLETED,SYSTEM_TIMER,SYSTEM_INIT,SYSTEM_LOGGER
COMMAND = NONE
SCHED = NICE,0
DAEMON = NO
END_COND = NONE
END_COND_TIMEOUT = -1
FAILURE_ACTION = NONE
ACTIVE = YES

#################################################################

GPL-Browser

Daily updated index of all pcd code findings on the GPL-Browser. Last update: 2024-05-26 04:12 GMT.
The Browse column points to the Path containing the respective source code on the gpl.boxmatrix.info service.
The SoC column lists the Chip-Codenames, the Model column lists the nicks of the Box-Models.
The Diff column links the comparison of the AVM Kernel to the pristine original from Kernel.org.
The Download column links the full tarball the respective directory content is extracted from.
The presence of the source does not mean it fits the respective model and architecture. See the Model-Matrix where it's used.

Dependencies

Daily updated index of all dependencies of this command. Last update: 2024-05-26 07:50 GMT.
A * in the Mod column marks info from Supportdata-Probes, which will always stay incomplete.

Relation Typ Object Mod Firmware Info Origin
Runs as proc pcd (process) 11* 5.24 - 7.61 Process Control Daemon, a supervisor alike service manager daemon. Puma
Depends on lib ld.so 3 7.90 Dynamic linker / loader Linux
Depends on lib libc.so 11 4.85 - 7.90 Standard C library Linux
Depends on lib libcap.so 4 7.14 - 7.90 POSIX 1003.1e capabilities library Linux
Depends on lib libdl.so 7 4.85 - 7.57 Dynamic linking library Linux
Depends on lib libgcc_s.so 4 7.04 - 7.90 GCC low-level runtime library Linux
Depends on lib libslibc.so 4 7.14 - 7.90 Bounds-checking C functions for use with the GNU C library Linux
Depends on lib libticc.so 11 4.85 - 7.90 Puma5 / Puma6 / Puma7 core communication API Puma
8 dependencies for this command

Model-Matrix

Daily updated index of the presence, path and size of this command for each model. Last update: 2024-05-26 05:15 GMT.
Showing all models using this command. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom) label in the Model column shows which CPU is meant for models with multiple Linux instances.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.

Model Firmware Path Size
FRITZ!Box 6320 Cable v1 6.03 - 6.04 /usr/sbin 54.8k - 54.9k
FRITZ!Box 6320 Cable v2 6.21 /usr/sbin 54.9k
FRITZ!Box 6340 Cable 5.24 /usr/sbin 50.4k
FRITZ!Box 6360 Cable 4.85 - 6.51 /usr/sbin 50.4k - 54.9k
FRITZ!Box 6430 Cable (arm) 6.84 - 7.29 /usr/sbin 38.1k - 42.4k
FRITZ!Box 6490 Cable (arm) 6.20 - 7.51 /usr/sbin 38.1k - 54.9k
FRITZ!Box 6590 Cable (arm) 6.83 - 7.57 /usr/sbin 38.1k - 42.4k
FRITZ!Box 6591 Cable (arm) 7.12 - 7.90 /usr/sbin 70.0k - 252k
FRITZ!Box 6660 Cable (arm) 7.14 - 7.90 /usr/sbin 70.0k - 252k
FRITZ!Box 6670 Cable (arm) 7.61 - 7.62 /usr/sbin 58.2k - 285k
FRITZ!Box 6690 Cable (arm) 7.28 - 7.90 /usr/sbin 70.0k - 252k
11 models use this command

Symbols

Daily updated index of all symbols of this command. Last update: 2024-05-26 07:50 GMT.

Firmware Symbol
0 symbols for this command

SMW-Browser

Information is currently being retrieved from the backend.