Bug 49914 - Добавить install2-init-functions для запуска команды
Summary: Добавить install2-init-functions для запуска команды
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: alterator-postinstall (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Andrey Cherepanov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-05 14:30 MSK by Alexander Shemetov
Modified: 2024-04-05 14:30 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Shemetov 2024-04-05 14:30:12 MSK
для варианта:

("/postinstall/laststate" run "command arg1 arg2")

предлагаю сделать так:

  if [ -n "$in_run" ] ; then
  	  destfile="$outdir/99-zz-auto_postinstall_run.sh"
	  echo "#!/bin/sh" > $destfile
	  echo "# alterator-postinstall create it" >> $destfile
	  echo ". install2-init-functions" >> $destfile
	  echo "$in_run"  >> $destfile
	  chmod a+x $destfile
	  printf '%s run:%s - OK\n' "$(date +%T)" "$in_run" >&2
  fi

чтобы можно было запускать команды в чруте:

("/postinstall/laststate" run "exec_chroot date +%s > /timestamp")

потому что все скрипты в postinstall.d подразумевают этот инклуд