Bug 49914

Summary: Добавить install2-init-functions для запуска команды
Product: Sisyphus Reporter: Alexander Shemetov <berkut_174>
Component: alterator-postinstallAssignee: Andrey Cherepanov <cas>
Status: NEW --- QA Contact: qa-sisyphus
Severity: normal    
Priority: P5 CC: cas
Version: unstable   
Hardware: x86_64   
OS: Linux   

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 подразумевают этот инклуд