The problem was that a pending job was not done. The printer was deactivated so cups couldn't finish this job. So cups seems to try printing this job and blocks the shutdown process till the cups process get killed.